From 1d595f048c9e59bbff14217e2fe3821ee3e1aaa1 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 9 May 2010 19:17:52 +0200 Subject: changed from SDL rendering to OpenGL draw, repaint methods do not have the SDL_Surface* parameter anymore --- src/base/texture.hpp | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'src/base/texture.hpp') diff --git a/src/base/texture.hpp b/src/base/texture.hpp index 016bb307..008707d6 100644 --- a/src/base/texture.hpp +++ b/src/base/texture.hpp @@ -29,33 +29,61 @@ #include #include + #include "utils/point_3d.hpp" #include "utils/dimension.hpp" #include "utils/rectangle.hpp" +#include "image.hpp" +#include "drawable.hpp" namespace usdx { - class Texture + class TextureLoadException + { + public: + TextureLoadException() {}; + virtual ~TextureLoadException() {}; + }; + + class TextureSizeException : public TextureLoadException { private: - GLuint tex_num; - Point3D position; Dimension size; - Dimension scale; ///< for dynamic scaling - float rotation; ///< radiant (0 - 2*pi) + public: + TextureSizeException(Dimension size) : size(size) { }; + virtual ~TextureSizeException() { }; + }; + + class TextureColorDepthException : public TextureLoadException + { + private: + unsigned int number_of_colors; - Dimension tex; ///< percentage of size to use [0..1] - Rectangle tex_rect; + public: + TextureColorDepthException(unsigned int number_of_colors) : number_of_colors(number_of_colors) {}; + virtual ~TextureColorDepthException() {}; + }; + + class Texture + { + private: + static log4cxx::LoggerPtr log; - boost::filesystem::wpath filename; ///< experimental for - ///handling cache - ///images. maybe it's useful - ///for dynamic skins + boost::filesystem::wpath filename; + + GLuint texture; + GLenum texture_format; + + Dimension size; + + float rotation; ///< radiant (0 - 2*pi) public: - Texture(); + Texture(boost::filesystem::wpath filename); virtual ~Texture(); + + GLuint get_texture(void) const; }; }; -- cgit v1.2.3