absence_thelab

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/3deng/textureman.h	Thu Oct 23 01:46:07 2014 +0300
     1.3 @@ -0,0 +1,39 @@
     1.4 +#ifndef _TEXTUREMAN_H_
     1.5 +#define _TEXTUREMAN_H_
     1.6 +
     1.7 +#include <string>
     1.8 +#include "hashtable.h"
     1.9 +#include "typedefs.h"
    1.10 +#include "d3d8.h"
    1.11 +#include "3dengtypes.h"
    1.12 +
    1.13 +class GraphicsContext;
    1.14 +
    1.15 +const dword UsageRenderTarget	= D3DUSAGE_RENDERTARGET;
    1.16 +const dword UsageDepthStencil	= D3DUSAGE_DEPTHSTENCIL;
    1.17 +
    1.18 +class TextureManager {
    1.19 +private:
    1.20 +	GraphicsContext *gc;
    1.21 +	HashTable<std::string, Texture*> textures;
    1.22 +	int notfilecount;
    1.23 +
    1.24 +	// private copy constructor and assignment op, to prohibit copying
    1.25 +	TextureManager(const TextureManager &tm) {}
    1.26 +	void operator =(const TextureManager &tm) {}
    1.27 +
    1.28 +	void CreateStockTextures();
    1.29 +
    1.30 +public:
    1.31 +	TextureManager(GraphicsContext *gc = 0);
    1.32 +	~TextureManager();
    1.33 +
    1.34 +	void SetGraphicsContext(GraphicsContext *gc);
    1.35 +
    1.36 +	Texture *LoadTexture(const char *fname);
    1.37 +	Texture *CreateTexture(dword x, dword y, dword usage, bool mipmaps, bool local=false);
    1.38 +	Texture *AddTexture(Texture *tex, const char *name=0);
    1.39 +	Texture *AddTexture(const char *fname);
    1.40 +};
    1.41 +
    1.42 +#endif	// _TEXTUREMAN_H_
    1.43 \ No newline at end of file