]> git.jsancho.org Git - lugaru.git/blob - Source/Texture.h
Some refactor about Person class.
[lugaru.git] / Source / Texture.h
1 #include <map>
2 #include <string>
3
4 //keeps track of which textures are loaded
5 //TODO: delete them properly
6 class Texture {
7         private:
8                 static std::map<std::string,Texture> textures;
9         
10                 bool isSkin;
11                 std::string fileName;
12                 GLuint id;
13                 bool mipmap;
14                 bool hasalpha;
15                 GLubyte* array;
16                 int arraySize;
17                 int skinsize;
18
19                 void load();
20
21         public:
22                 Texture():
23                         isSkin(false), skinsize(0), arraySize(0),
24                         fileName(""), id(0), mipmap(false), hasalpha(false), array(NULL) { }
25                 ~Texture();
26                 Texture (const std::string& _fileName, bool _mipmap, bool _hasalpha):
27                         isSkin(false), skinsize(0), arraySize(0), array(NULL),
28                         fileName(_fileName), id(0), mipmap(_mipmap), hasalpha(_hasalpha) { }
29                 Texture (const std::string& _fileName, bool _mipmap, bool _hasalpha, bool _isSkin):
30                         isSkin(_isSkin), skinsize(0), arraySize(0), array(NULL),
31                         fileName(_fileName), id(0), mipmap(_mipmap), hasalpha(_hasalpha) { }
32                 GLuint getId() const { return id; }
33                 
34                 static GLuint Load(const std::string& fileName, bool mipmap, bool hasalpha);
35                 static GLuint Load(const std::string& fileName, bool mipmap, bool hasalpha, GLubyte* array, int* skinsize);
36 };
37