21 #ifndef Tulip_GLTEXTUREMANAGER_H
22 #define Tulip_GLTEXTUREMANAGER_H
26 #include <tulip/tulipconf.h>
29 #include <tulip/OpenGlConfigManager.h>
40 unsigned int spriteNumber;
46 class TLP_GL_SCOPE GlTextureManager {
48 typedef std::map<std::string,GlTexture> TextureUnit;
49 typedef std::map<unsigned long,TextureUnit> ContextAndTextureMap;
56 static void createInst();
60 static GlTextureManager &getInst() {
62 inst=
new GlTextureManager();
70 void changeContext(
unsigned long context);
74 void removeContext(
unsigned long context);
79 GlTexture getTextureInfo(
const std::string&);
84 bool existsTexture(
const std::string& filename);
88 bool loadTexture(
const std::string&);
92 void deleteTexture(
const std::string &);
96 void beginNewTexture(
const std::string&);
100 bool activateTexture(
const std::string&,
unsigned int);
104 bool activateTexture(
const std::string&);
108 void desactivateTexture();
112 void setAnimationFrame(
unsigned int id) {
118 unsigned int getAnimationFrame() {
119 return animationFrame;
124 void clearErrorVector() {
125 texturesWithError.clear();
130 void removeEntryOfErrorVector(
const std::string &name) {
131 texturesWithError.erase(name);
138 void registerExternalTexture(
const std::string &textureName,
const GLuint textureId);
147 static GlTextureManager* inst;
149 unsigned long currentContext;
151 ContextAndTextureMap texturesMap;
152 std::set<std::string> texturesWithError;
154 unsigned int animationFrame;
160 #endif // Tulip_GLTEXTUREMANAGER_H