00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef WP_TEXTUREMANAGER_H
00018 #define WP_TEXTUREMANAGER_H
00019
00020 #include <list>
00021 #include "WPCG.h"
00022
00023 namespace WPCG
00024 {
00043 class WP_TextureManager
00044 {
00045 public:
00046 ~WP_TextureManager();
00047
00052 static WP_TextureManager* getInstance();
00053
00060 int getTexture(const string &name, void* owner);
00061
00067 bool removeTextures(void* owner);
00068
00072 bool mipmapping;
00073
00074 private:
00075 WP_TextureManager();
00076
00095 class WP_Texture
00096 {
00097 public:
00098 WP_Texture():texture_id(0), texture_ok(false){};
00099
00103 WP_Texture(const string &name);
00104 ~WP_Texture();
00105
00111 bool removeInstance(void* owner);
00112
00116 string name;
00117
00121 GLuint texture_id;
00122
00126 list<void*> owners;
00127
00131 bool texture_ok;
00132 };
00133
00139 WP_Texture* findInstance(const string &name);
00140
00146 int countTextures(void* owner) const;
00147
00151 list<WP_Texture*> textures;
00152
00156 static WP_TextureManager* tm_instance;
00157 };
00158 }
00159 #endif