Changeset 5768 in orxonox.OLD for trunk/src/lib/graphics/importer/texture.h
- Timestamp:
- Nov 24, 2005, 8:24:52 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/texture.h
r5755 r5768 1 1 /*! 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 */ 7 5 8 6 #ifndef _TEXTURE_H 9 7 #define _TEXTURE_H 10 8 11 #include "glincl.h"12 9 #include "base_object.h" 13 10 14 #include " debug.h"11 #include "glincl.h" 15 12 13 /* Forward Declaration */ 16 14 struct SDL_Surface; 17 15 18 16 //! an enumerator for different procedural texture-types 19 17 typedef enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS, 20 18 TEXTURE_NOISE }; 21 19 22 20 //! A Class, that reads in Textures from different fileformats. 23 class Texture : public BaseObject24 {25 public:26 Texture(const char* imageName = NULL);21 class Texture : public BaseObject 22 { 23 public: 24 Texture(const char* imageName = NULL); 27 25 // Texture(TEXTURE_TYPE type, int resolution); 28 ~Texture();26 ~Texture(); 29 27 30 bool loadImage(const char* imageName);31 bool rebuild();28 bool loadImage(const char* imageName); 29 bool rebuild(); 32 30 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;} 37 35 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); 41 39 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 }; 47 47 48 48 #endif /* _TEXTURE_H */
Note: See TracChangeset
for help on using the changeset viewer.