/*! \file texture.h \brief Contains the texture class, that handles the reading of Images into Texutre-files. \todo free SDL-surface when deleting Material. \todo delete imgNameWithPath after use creation. */ #ifndef _TEXTURE_H #define _TEXTURE_H #include "sdlincl.h" #include "glincl.h" #include "debug.h" enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS, TEXTURE_NOISE }; //! A Class, that reads in Textures from different fileformats. class Texture { private: GLuint texture; //!< The Texture-ID of opengl from this Texture. char* searchTextureInPaths(const char* texName) const; bool bAlpha; //!< if the texture has an alpha channel. public: Texture(const char* imageName = NULL); Texture(TEXTURE_TYPE type, int resolution); ~Texture(void); /** \returns The textureID of this texture. */ inline GLuint getTexture(void) {return this->texture;} GLuint loadTexToGL (SDL_Surface* surface); inline bool hasAlpha(void) {return bAlpha;} bool loadImage(const char* imageName); }; #endif /* _TEXTURE_H */