00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(AFX_GLTEXTURE_H__9DA92C48_B9A4_4517_AB9F_55141CCDA817__INCLUDED_)
00022 #define AFX_GLTEXTURE_H__9DA92C48_B9A4_4517_AB9F_55141CCDA817__INCLUDED_
00023
00024 #include <GLEXT/GLState.h>
00025 #include <image/Image.h>
00026 #include <GLEXT/GLTextureBase.h>
00027
00028 class GLTexture : public GLTextureBase
00029 {
00030 public:
00031 GLTexture();
00032 virtual ~GLTexture();
00033
00034 virtual void draw(bool force = false);
00035
00036 bool create(Image &bitmap,
00037 bool mipMap = true);
00038 bool create(const void * data,
00039 GLint width,
00040 GLint height,
00041 GLint components,
00042 GLint alignment = 4,
00043 GLenum format = GL_RGB,
00044 bool mipMap = true);
00045 bool create(GLint width,
00046 GLint height,
00047 GLenum format = GL_RGB);
00048 bool createBufferTexture(GLint width,
00049 GLint height,
00050 bool depthTex);
00051 bool replace(Image &bitmap,
00052 bool mipMap = true);
00053
00054 bool textureValid();
00055 GLenum getTexType() { return texType_; }
00056 GLenum getTexFormat() { return texFormat_; }
00057 GLuint getTexName() { return texNum_; }
00058 int getWidth() { return width_; }
00059 int getHeight() { return height_; }
00060
00061 static unsigned int getTextureSpace() { return textureSpace_; }
00062 static unsigned int getTextureSets() { return textureSets_; }
00063 static void resetTextureSets() { textureSets_ = 0; }
00064 static bool validateSize(int size);
00065
00066 protected:
00067 static unsigned int textureSpace_;
00068 static unsigned int textureSets_;
00069 unsigned int usedSpace_;
00070 int width_, height_;
00071 GLuint texNum_;
00072 GLenum texType_;
00073 GLenum texFormat_;
00074
00075 bool createTexture(const void * data,
00076 GLint width,
00077 GLint height,
00078 GLint components,
00079 GLint alignment,
00080 GLenum format,
00081 bool mipMap);
00082 bool createObject();
00083 };
00084
00085 #endif // !defined(AFX_GLTEXTURE_H__9DA92C48_B9A4_4517_AB9F_55141CCDA817__INCLUDED_)