Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 10196 was 9869, checked in by bensch, 18 years ago

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.3 KB
Line 
1/*!
2 * @file texture_data.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    typedef CountPointer<TextureData> Pointer;
22  public:
23    TextureData();
24    ~TextureData();
25
26    inline GLuint getTexture() const { return this->texture; };
27    /** @returns true if texture has alpha, false otherwise */
28    inline bool hasAlpha() const  {return this->bAlpha; }
29    /** @returns the stored image of this Texture */
30    const SDL_Surface* const getStoredImage() const { return this->image; };
31
32    bool loadSurface(SDL_Surface* surface, GLenum target = GL_TEXTURE_2D);
33
34    bool rebuild();
35
36    bool setSurface(SDL_Surface* newSurface);
37    /** @returns true if the Surface has an Alpha Value. */
38    bool setAlpha(bool hasAlpha) { this->bAlpha = hasAlpha; return this->bAlpha; };
39    bool setTexture(GLuint texture);
40
41  private:
42    GLuint           texture;            //!< The Texture-ID of opengl from this Texture.
43    bool             bAlpha;             //!< if the texture has an alpha channel.
44    SDL_Surface*     image;              //!< The SDL_Surfce that stores the Texture on it.
45};
46
47#endif /* _TEXTURE_DATA_H */
Note: See TracBrowser for help on using the repository browser.