summaryrefslogtreecommitdiff
path: root/include/texture.h
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-26 14:07:43 +0000
committerpixel <pixel>2003-03-26 14:07:43 +0000
commitc00cd54ca5ed959cbccff7aa7261fb5025d1832c (patch)
treee706afd7029361a9f59882452a8ad2ecf2da0db6 /include/texture.h
parenta749e5e0f870dc2acde2de55cba2cd074d524442 (diff)
bleh
Diffstat (limited to 'include/texture.h')
-rw-r--r--include/texture.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/texture.h b/include/texture.h
new file mode 100644
index 0000000..4f5e162
--- /dev/null
+++ b/include/texture.h
@@ -0,0 +1,39 @@
+#ifndef __GLTEXTURE_H__
+#define __GLTEXTURE_H__
+
+#include <SDL.h>
+#include <SDL_opengl.h>
+#include <Handle.h>
+#include <Exceptions.h>
+#include <generic.h>
+
+namespace mogltk {
+ class texture : public Base {
+ public:
+ texture(int = 256, int = 256, bool = false) throw (GeneralException);
+ texture(Handle *, bool = false) throw (GeneralException);
+ virtual ~texture();
+ SDL_Surface * GetSurface();
+ Uint32 * GetPixels();
+ static SDL_Surface * LoadNTEX(Handle * h) throw (GeneralException) ;
+ void Generate();
+ void Bind(bool = true);
+ GLuint GetWidth();
+ GLuint GetHeight();
+ static void Unbind(void);
+ void Taint(void);
+ private:
+ GLuint width, height, tex;
+ bool texture_allocated;
+ SDL_Surface * surface;
+ bool planar, tainted;
+#ifdef TRACE_TEXTURES
+ static texture * header;
+ static texture * footer;
+ texture * next, * prev;
+#endif
+ static texture * active;
+ };
+};
+
+#endif