summaryrefslogtreecommitdiff
path: root/include/gltexture.h
blob: 9cbfe547f781265a27b6dc1604cc5f39faaeeebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __GLTEXTURE_H__
#define __GLTEXTURE_H__

#include <GL/gl.h>
#include <SDL.h>
#include <Exceptions.h>

namespace mogltk {
    class texture : public Base {
      public:
          texture(int = 256, int = 256, bool = false) throw (GeneralException);
	  virtual ~texture();
	SDL_Surface * GetSurface();
	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