From 11e4937c9f9af5e064ad7434b2e4bf47b5fe31f6 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Mon, 17 Sep 2012 01:33:32 +0200 Subject: 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. --- src/menu/texture.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/menu/texture.hpp') 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); }; }; -- cgit v1.2.3