Rev | Line | |
---|
[3341] | 1 | /*! |
---|
| 2 | \file texture.h |
---|
| 3 | \brief Contains the texture class, that handles the reading of Images into Texutre-files. |
---|
| 4 | |
---|
[4466] | 5 | \todo procedural textures |
---|
[3341] | 6 | */ |
---|
| 7 | |
---|
| 8 | #ifndef _TEXTURE_H |
---|
| 9 | #define _TEXTURE_H |
---|
| 10 | |
---|
[4381] | 11 | #include "sdlincl.h" |
---|
[3548] | 12 | #include "glincl.h" |
---|
| 13 | |
---|
| 14 | #include "debug.h" |
---|
| 15 | |
---|
[4466] | 16 | //! an enumerator for different procedural texture-types |
---|
| 17 | typedef enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS, |
---|
| 18 | TEXTURE_NOISE }; |
---|
[3341] | 19 | |
---|
| 20 | //! A Class, that reads in Textures from different fileformats. |
---|
| 21 | class Texture |
---|
| 22 | { |
---|
| 23 | public: |
---|
[3905] | 24 | Texture(const char* imageName = NULL); |
---|
[4466] | 25 | // Texture(TEXTURE_TYPE type, int resolution); |
---|
| 26 | |
---|
[4746] | 27 | ~Texture(); |
---|
[3905] | 28 | |
---|
[3454] | 29 | /** \returns The textureID of this texture. */ |
---|
[4746] | 30 | inline GLuint getTexture() {return this->texture;} |
---|
[3905] | 31 | GLuint loadTexToGL (SDL_Surface* surface); |
---|
[4466] | 32 | /** \returns true if texture has alpha, false otherwise */ |
---|
[4746] | 33 | inline bool hasAlpha() const {return bAlpha;} |
---|
[3341] | 34 | |
---|
[3655] | 35 | bool loadImage(const char* imageName); |
---|
[4466] | 36 | |
---|
| 37 | |
---|
| 38 | private: |
---|
| 39 | GLuint texture; //!< The Texture-ID of opengl from this Texture. |
---|
| 40 | bool bAlpha; //!< if the texture has an alpha channel. |
---|
[3863] | 41 | }; |
---|
[3341] | 42 | |
---|
| 43 | #endif /* _TEXTURE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.