Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: objModel's materials should now automatically load textures

File size: 1.0 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
26  bool bAlpha;           //!< if the texture has an alpha channel.
27 public:
28  Texture(const char* imageName = NULL);
29  Texture(TEXTURE_TYPE type, int resolution);
30  ~Texture(void);
31
32  /** \returns The textureID of this texture.  */
33  inline GLuint getTexture(void) {return this->texture;} 
34  GLuint loadTexToGL (SDL_Surface* surface);
35  inline bool hasAlpha(void) {return bAlpha;}
36
37  bool loadImage(const char* imageName);
38};
39
40#endif /* _TEXTURE_H */
Note: See TracBrowser for help on using the repository browser.