Last change
on this file since 10585 was
10460,
checked in by patrick, 18 years ago
|
some texture attributes, camera target fix
|
File size:
1.6 KB
|
Rev | Line | |
---|
[3341] | 1 | /*! |
---|
[8751] | 2 | * @file texture_data.h |
---|
[5768] | 3 | * @brief Contains the texture class, that handles the reading of Images into Texutre-files. |
---|
| 4 | */ |
---|
[3341] | 5 | |
---|
[8363] | 6 | #ifndef _TEXTURE_DATA_H |
---|
| 7 | #define _TEXTURE_DATA_H |
---|
[3341] | 8 | |
---|
[5304] | 9 | #include "base_object.h" |
---|
[3548] | 10 | |
---|
[5768] | 11 | #include "glincl.h" |
---|
[7785] | 12 | #include "count_pointer.h" |
---|
[10460] | 13 | #include "sdlincl.h" |
---|
[3548] | 14 | |
---|
[10460] | 15 | |
---|
[5768] | 16 | /* Forward Declaration */ |
---|
[5239] | 17 | struct SDL_Surface; |
---|
| 18 | |
---|
[7785] | 19 | |
---|
| 20 | class TextureData |
---|
| 21 | { |
---|
| 22 | public: |
---|
[9869] | 23 | typedef CountPointer<TextureData> Pointer; |
---|
| 24 | public: |
---|
[7785] | 25 | TextureData(); |
---|
| 26 | ~TextureData(); |
---|
| 27 | |
---|
| 28 | inline GLuint getTexture() const { return this->texture; }; |
---|
| 29 | /** @returns true if texture has alpha, false otherwise */ |
---|
| 30 | inline bool hasAlpha() const {return this->bAlpha; } |
---|
| 31 | /** @returns the stored image of this Texture */ |
---|
| 32 | const SDL_Surface* const getStoredImage() const { return this->image; }; |
---|
| 33 | |
---|
| 34 | bool loadSurface(SDL_Surface* surface, GLenum target = GL_TEXTURE_2D); |
---|
| 35 | |
---|
| 36 | bool rebuild(); |
---|
| 37 | |
---|
| 38 | bool setSurface(SDL_Surface* newSurface); |
---|
[7788] | 39 | /** @returns true if the Surface has an Alpha Value. */ |
---|
[8145] | 40 | bool setAlpha(bool hasAlpha) { this->bAlpha = hasAlpha; return this->bAlpha; }; |
---|
[7785] | 41 | bool setTexture(GLuint texture); |
---|
[10460] | 42 | float getHeight() { return this->height;} |
---|
| 43 | float getWidth() { return this->width; } |
---|
[7785] | 44 | |
---|
| 45 | private: |
---|
[10460] | 46 | float height; //!< height of tex |
---|
| 47 | float width; //!< width of tex |
---|
[7785] | 48 | GLuint texture; //!< The Texture-ID of opengl from this Texture. |
---|
| 49 | bool bAlpha; //!< if the texture has an alpha channel. |
---|
| 50 | SDL_Surface* image; //!< The SDL_Surfce that stores the Texture on it. |
---|
| 51 | }; |
---|
| 52 | |
---|
[8363] | 53 | #endif /* _TEXTURE_DATA_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.