Last change
on this file since 5855 was
5768,
checked in by bensch, 19 years ago
|
orxonox/trunk: font is a Texture now (this is a procedural texture)
|
File size:
1.3 KB
|
Rev | Line | |
---|
[3341] | 1 | /*! |
---|
[5768] | 2 | * @file texture.h |
---|
| 3 | * @brief Contains the texture class, that handles the reading of Images into Texutre-files. |
---|
| 4 | */ |
---|
[3341] | 5 | |
---|
| 6 | #ifndef _TEXTURE_H |
---|
| 7 | #define _TEXTURE_H |
---|
| 8 | |
---|
[5304] | 9 | #include "base_object.h" |
---|
[3548] | 10 | |
---|
[5768] | 11 | #include "glincl.h" |
---|
[3548] | 12 | |
---|
[5768] | 13 | /* Forward Declaration */ |
---|
[5239] | 14 | struct SDL_Surface; |
---|
| 15 | |
---|
[4466] | 16 | //! an enumerator for different procedural texture-types |
---|
| 17 | typedef enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS, |
---|
[5768] | 18 | TEXTURE_NOISE }; |
---|
[3341] | 19 | |
---|
| 20 | //! A Class, that reads in Textures from different fileformats. |
---|
[5768] | 21 | class Texture : public BaseObject |
---|
| 22 | { |
---|
| 23 | public: |
---|
| 24 | Texture(const char* imageName = NULL); |
---|
[4466] | 25 | // Texture(TEXTURE_TYPE type, int resolution); |
---|
[5768] | 26 | ~Texture(); |
---|
[3905] | 27 | |
---|
[5768] | 28 | bool loadImage(const char* imageName); |
---|
| 29 | bool rebuild(); |
---|
[5753] | 30 | |
---|
[5768] | 31 | /** @returns The textureID of this texture. */ |
---|
| 32 | inline GLuint getTexture() const { return this->texture; }; |
---|
| 33 | /** @returns true if texture has alpha, false otherwise */ |
---|
| 34 | inline bool hasAlpha() const {return bAlpha;} |
---|
[3341] | 35 | |
---|
[5768] | 36 | protected: |
---|
| 37 | bool prepareSurface(SDL_Surface* input); |
---|
| 38 | bool setSurface(SDL_Surface* newSurface); |
---|
[4466] | 39 | |
---|
[5768] | 40 | GLuint loadTexToGL (); |
---|
[3341] | 41 | |
---|
[5768] | 42 | private: |
---|
| 43 | GLuint texture; //!< The Texture-ID of opengl from this Texture. |
---|
| 44 | bool bAlpha; //!< if the texture has an alpha channel. |
---|
| 45 | SDL_Surface* image; //!< The SDL_Surfce that stores the Texture on it. |
---|
| 46 | }; |
---|
| 47 | |
---|
[3341] | 48 | #endif /* _TEXTURE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.