aboutsummaryrefslogtreecommitdiffstats
path: root/src/base/texture.hpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-05-09 19:17:52 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:48 +0100
commit1d595f048c9e59bbff14217e2fe3821ee3e1aaa1 (patch)
treefe92fea4e73324bd3645afb52c681d103624b853 /src/base/texture.hpp
parent3ca6e32a9ecaa8514b9a30711cec20cf80722c23 (diff)
downloadusdx-1d595f048c9e59bbff14217e2fe3821ee3e1aaa1.tar.gz
usdx-1d595f048c9e59bbff14217e2fe3821ee3e1aaa1.tar.xz
usdx-1d595f048c9e59bbff14217e2fe3821ee3e1aaa1.zip
changed from SDL rendering to OpenGL
draw, repaint methods do not have the SDL_Surface* parameter anymore
Diffstat (limited to 'src/base/texture.hpp')
-rw-r--r--src/base/texture.hpp52
1 files changed, 40 insertions, 12 deletions
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 <boost/filesystem.hpp>
#include <GL/gl.h>
+
#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;
};
};