#ifndef __GLTEXTUR_H #define __GLTEXTUR_H #include #include #include #include #include #include #include "sdlfuncs.h" class GLTexture { private: GLuint texint; SDL_Surface *tex; int width, height; std::string filename; // wenn von datei geladen // Parameter GLint minfilter; GLint magfilter; GLint wraps; GLint wrapt; bool loaded; bool texconverted; bool keepsurface; bool donotreload; void init(); bool loadLocalSurface(); void convertLocalSurface(); static std::vector alltextures; protected: GLTexture(SDL_Surface*); bool loadSurface(SDL_Surface*, bool = false); public: static void reloadAll(); GLTexture(); GLTexture(std::string, GLint=GL_LINEAR, GLint=GL_LINEAR, GLint=GL_REPEAT, GLint=GL_REPEAT); ~GLTexture(); //load bool loadImage(std::string); bool selectTexture(); void unloadTexture(); bool setParameter(GLint=0, GLint=0, GLint=0, GLint=0); inline bool select() { return selectTexture(); } int getW(); int getH(); bool isLoaded(); }; #endif