Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 24, 2005, 8:24:52 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: font is a Texture now (this is a procedural texture)

File:
1 edited

Legend:

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

    r5755 r5768  
    11/*!
    2   \file texture.h
    3   \brief Contains the texture class, that handles the reading of Images into Texutre-files.
    4 
    5   @todo procedural textures
    6 */
     2 * @file texture.h
     3 * @brief Contains the texture class, that handles the reading of Images into Texutre-files.
     4 */
    75
    86#ifndef _TEXTURE_H
    97#define _TEXTURE_H
    108
    11 #include "glincl.h"
    129#include "base_object.h"
    1310
    14 #include "debug.h"
     11#include "glincl.h"
    1512
     13/* Forward Declaration */
    1614struct SDL_Surface;
    1715
    1816//! an enumerator for different procedural texture-types
    1917typedef enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS,
    20                             TEXTURE_NOISE };
     18  TEXTURE_NOISE };
    2119
    2220//! A Class, that reads in Textures from different fileformats.
    23 class Texture : public BaseObject
    24 {
    25  public:
    26   Texture(const char* imageName = NULL);
     21  class Texture : public BaseObject
     22  {
     23    public:
     24      Texture(const char* imageName = NULL);
    2725  //  Texture(TEXTURE_TYPE type, int resolution);
    28   ~Texture();
     26      ~Texture();
    2927
    30   bool loadImage(const char* imageName);
    31   bool rebuild();
     28      bool loadImage(const char* imageName);
     29      bool rebuild();
    3230
    33   /** @returns The textureID of this texture.  */
    34   inline GLuint getTexture() const { return this->texture; };
    35   /** @returns true if texture has alpha, false otherwise */
    36   inline bool hasAlpha() const {return bAlpha;}
     31      /** @returns The textureID of this texture.  */
     32      inline GLuint getTexture() const { return this->texture; };
     33      /** @returns true if texture has alpha, false otherwise */
     34      inline bool hasAlpha() const {return bAlpha;}
    3735
    38  private:
    39   SDL_Surface* prepareSurface(SDL_Surface* input);
    40   GLuint loadTexToGL (SDL_Surface* surface) const;
     36    protected:
     37      bool prepareSurface(SDL_Surface* input);
     38      bool setSurface(SDL_Surface* newSurface);
    4139
    42  private:
    43   GLuint        texture;            //!< The Texture-ID of opengl from this Texture.
    44   bool          bAlpha;             //!< if the texture has an alpha channel.
    45   SDL_Surface*  image;   
    46 };
     40      GLuint loadTexToGL ();
     41
     42    private:
     43      GLuint        texture;            //!< The Texture-ID of opengl from this Texture.
     44      bool          bAlpha;             //!< if the texture has an alpha channel.
     45      SDL_Surface*  image;              //!< The SDL_Surfce that stores the Texture on it.
     46  };
    4747
    4848#endif /* _TEXTURE_H */
Note: See TracChangeset for help on using the changeset viewer.