GLTexture.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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_)

Generated on Mon Feb 16 15:14:45 2009 for Scorched3D by  doxygen 1.5.3