Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/hud/src/lib/graphics/importer/texture_data.h @ 10678

Last change on this file since 10678 was 10460, checked in by patrick, 18 years ago

some texture attributes, camera target fix

File size: 1.6 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#include "sdlincl.h"
14
15
16/* Forward Declaration */
17struct SDL_Surface;
18
19
20class TextureData
21{
22  public:
23    typedef CountPointer<TextureData> Pointer;
24  public:
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);
39    /** @returns true if the Surface has an Alpha Value. */
40    bool setAlpha(bool hasAlpha) { this->bAlpha = hasAlpha; return this->bAlpha; };
41    bool setTexture(GLuint texture);
42    float getHeight() { return this->height;}
43    float getWidth() { return this->width; }
44
45  private:
46    float            height;             //!< height of tex
47    float            width;              //!< width of tex
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
53#endif /* _TEXTURE_DATA_H */
Note: See TracBrowser for help on using the repository browser.