Last change
on this file since 5840 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
|
Line | |
---|
1 | /*! |
---|
2 | * @file texture.h |
---|
3 | * @brief Contains the texture class, that handles the reading of Images into Texutre-files. |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _TEXTURE_H |
---|
7 | #define _TEXTURE_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | |
---|
11 | #include "glincl.h" |
---|
12 | |
---|
13 | /* Forward Declaration */ |
---|
14 | struct SDL_Surface; |
---|
15 | |
---|
16 | //! an enumerator for different procedural texture-types |
---|
17 | typedef enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS, |
---|
18 | TEXTURE_NOISE }; |
---|
19 | |
---|
20 | //! A Class, that reads in Textures from different fileformats. |
---|
21 | class Texture : public BaseObject |
---|
22 | { |
---|
23 | public: |
---|
24 | Texture(const char* imageName = NULL); |
---|
25 | // Texture(TEXTURE_TYPE type, int resolution); |
---|
26 | ~Texture(); |
---|
27 | |
---|
28 | bool loadImage(const char* imageName); |
---|
29 | bool rebuild(); |
---|
30 | |
---|
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;} |
---|
35 | |
---|
36 | protected: |
---|
37 | bool prepareSurface(SDL_Surface* input); |
---|
38 | bool setSurface(SDL_Surface* newSurface); |
---|
39 | |
---|
40 | GLuint loadTexToGL (); |
---|
41 | |
---|
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 | |
---|
48 | #endif /* _TEXTURE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.