diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-09-17 01:33:32 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-13 22:41:06 +0100 |
commit | 11e4937c9f9af5e064ad7434b2e4bf47b5fe31f6 (patch) | |
tree | 79390376632122609c710230390c0f4710c3b3e7 /src/menu/texture.hpp | |
parent | 368ff00d125f00e9fcfc536f198697aba79c2d40 (diff) | |
download | usdx-11e4937c9f9af5e064ad7434b2e4bf47b5fe31f6.tar.gz usdx-11e4937c9f9af5e064ad7434b2e4bf47b5fe31f6.tar.xz usdx-11e4937c9f9af5e064ad7434b2e4bf47b5fe31f6.zip |
menu/texture: implement GlDelayedAllocation interface
Textures are now initialized during their first use, destroyed after
their last used and could be use with the Activator.
Diffstat (limited to 'src/menu/texture.hpp')
-rw-r--r-- | src/menu/texture.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/menu/texture.hpp b/src/menu/texture.hpp index 12a32e46..9dfa2fa1 100644 --- a/src/menu/texture.hpp +++ b/src/menu/texture.hpp @@ -34,6 +34,7 @@ #include "utils/rectangle.hpp" #include "utils/image.hpp" #include "drawable.hpp" +#include "gl_delayed_allocation.hpp" namespace usdx { @@ -64,7 +65,7 @@ namespace usdx virtual ~TextureColorDepthException() {}; }; - class Texture + class Texture : public GlDelayedAllocation { private: static log4cpp::Category& log; @@ -78,11 +79,16 @@ namespace usdx float rotation; ///< radiant (0 - 2*pi) + virtual void gl_initialize(); + virtual void gl_cleanup(); public: Texture(boost::filesystem::wpath filename); virtual ~Texture(); - GLuint get_texture(void) const; + const static GLfloat default_vertices[]; + + virtual void enable(void); + virtual void disable(void); }; }; |