#ifndef __TEXTURE_H__ #define __TEXTURE_H__ #include #include #include #include #include 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