absence_thelab

view src/3deng/textureman.h @ 0:1cffe3409164

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 23 Oct 2014 01:46:07 +0300
parents
children
line source
1 #ifndef _TEXTUREMAN_H_
2 #define _TEXTUREMAN_H_
4 #include <string>
5 #include "hashtable.h"
6 #include "typedefs.h"
7 #include "d3d8.h"
8 #include "3dengtypes.h"
10 class GraphicsContext;
12 const dword UsageRenderTarget = D3DUSAGE_RENDERTARGET;
13 const dword UsageDepthStencil = D3DUSAGE_DEPTHSTENCIL;
15 class TextureManager {
16 private:
17 GraphicsContext *gc;
18 HashTable<std::string, Texture*> textures;
19 int notfilecount;
21 // private copy constructor and assignment op, to prohibit copying
22 TextureManager(const TextureManager &tm) {}
23 void operator =(const TextureManager &tm) {}
25 void CreateStockTextures();
27 public:
28 TextureManager(GraphicsContext *gc = 0);
29 ~TextureManager();
31 void SetGraphicsContext(GraphicsContext *gc);
33 Texture *LoadTexture(const char *fname);
34 Texture *CreateTexture(dword x, dword y, dword usage, bool mipmaps, bool local=false);
35 Texture *AddTexture(Texture *tex, const char *name=0);
36 Texture *AddTexture(const char *fname);
37 };
39 #endif // _TEXTUREMAN_H_