Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/importer/texture_data.h @ 8506

Last change on this file since 8506 was 8363, checked in by bensch, 18 years ago

trunk: splitted Texture and TextureData into two files.
Also fixed the Creator-Function for Textures with empty textures with size

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_DATA_H
7#define _TEXTURE_DATA_H
8
9#include "base_object.h"
10
11#include "glincl.h"
12#include "count_pointer.h"
13
14/* Forward Declaration */
15struct SDL_Surface;
16
17
18class TextureData
19{
20  public:
21    TextureData();
22    ~TextureData();
23
24    inline GLuint getTexture() const { return this->texture; };
25    /** @returns true if texture has alpha, false otherwise */
26    inline bool hasAlpha() const  {return this->bAlpha; }
27    /** @returns the stored image of this Texture */
28    const SDL_Surface* const getStoredImage() const { return this->image; };
29
30    bool loadSurface(SDL_Surface* surface, GLenum target = GL_TEXTURE_2D);
31
32    bool rebuild();
33
34    bool setSurface(SDL_Surface* newSurface);
35    /** @returns true if the Surface has an Alpha Value. */
36    bool setAlpha(bool hasAlpha) { this->bAlpha = hasAlpha; return this->bAlpha; };
37    bool setTexture(GLuint texture);
38
39  private:
40    GLuint           texture;            //!< The Texture-ID of opengl from this Texture.
41    bool             bAlpha;             //!< if the texture has an alpha channel.
42    SDL_Surface*     image;              //!< The SDL_Surfce that stores the Texture on it.
43};
44
45#endif /* _TEXTURE_DATA_H */
Note: See TracBrowser for help on using the repository browser.