Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/graphics/importer/texture.h @ 4357

Last change on this file since 4357 was 4357, checked in by bensch, 19 years ago

orxonox/trunk: now Textures are maped as they should
before this textures where switched upside-down, now this is done in the corresponding model's textureCoordinate

File size: 1.1 KB
Line 
1/*!
2  \file texture.h
3  \brief Contains the texture class, that handles the reading of Images into Texutre-files.
4
5  \todo free SDL-surface when deleting Material.
6  \todo delete imgNameWithPath after use creation.
7*/
8
9#ifndef _TEXTURE_H
10#define _TEXTURE_H
11
12#include "glincl.h"
13
14#include "debug.h"
15
16enum TEXTURE_TYPE { TEXTURE_RADIAL_ALIAS,
17                    TEXTURE_NOISE };
18
19//! A Class, that reads in Textures from different fileformats.
20class Texture
21{
22 private:
23  GLuint texture;   //!< The Texture-ID of opengl from this Texture.
24  char* searchTextureInPaths(const char* texName) const;
25  void swap(unsigned char &a, unsigned char &b);
26
27  bool bAlpha;           //!< if the texture has an alpha channel.
28 public:
29  Texture(const char* imageName = NULL);
30  Texture(TEXTURE_TYPE type, int resolution);
31  ~Texture(void);
32
33  /** \returns The textureID of this texture.  */
34  inline GLuint getTexture(void) {return this->texture;} 
35  GLuint loadTexToGL (SDL_Surface* surface);
36  inline bool hasAlpha(void) {return bAlpha;}
37
38  bool loadImage(const char* imageName);
39};
40
41#endif /* _TEXTURE_H */
Note: See TracBrowser for help on using the repository browser.