Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8363 in orxonox.OLD for trunk/src/lib/graphics/importer/texture.h


Ignore:
Timestamp:
Jun 14, 2006, 10:37:08 AM (18 years ago)
Author:
bensch
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/texture.h

    r8312 r8363  
    1111#include "glincl.h"
    1212#include "count_pointer.h"
     13#include "texture_data.h"
     14
    1315
    1416/* Forward Declaration */
    1517struct SDL_Surface;
    16 
    17 
    18 class 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 
    4518
    4619//! A Class, that reads in Textures from different fileformats.
Note: See TracChangeset for help on using the changeset viewer.