Page principale | Hiérarchie des classes | Liste alphabétique | Liste des classes | Liste des fichiers | Membres de classe

C:/Projects/ngn/include/texture.h

00001 /***************************************************************************
00002  *            texture.h
00003  *
00004  *  Wed Feb 18 07:37:03 2004
00005  *  Copyright  2004  thierry schartz
00006  *  thierry.schartz@skynet.be
00007  ****************************************************************************/
00008 /*
00009  *  This program is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  This program is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU Library General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with this program; if not, write to the Free Software
00021  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00022  */
00023 #ifndef _TEXTURE_H
00024 #define _TEXTURE_H
00025 
00026 #ifdef WIN32
00027 #include <windows.h>
00028 #endif
00029 
00030 
00031 #include <vector>
00032 #include <string>
00033 #include "GLee.h"
00034 #include "build.h"
00035 
00036 #define MAX_TEXTURES 1024
00037 
00038 namespace ngn {
00039         namespace core {
00040 
00041 
00042 
00043         typedef enum
00044         {
00045                 TEX_NONE,
00046                 TEX_REPEAT,
00047                 TEX_CLAMP,
00048                 TEX_CLAMP_TO_BORDER,
00049                 TEX_CLAMP_TO_EDGE
00050         
00051         } texflag ;
00052 
00057         class NGN_API Texture
00058         {
00059         public:
00060                         static GLuint TexArray[ MAX_TEXTURES ]; // textures id's
00061                         static std::string TexDir;
00062 
00063                         Texture();
00064                         virtual ~Texture();
00065                         
00067                         GLuint getTextureID();
00069                         std::string getTexturePath();
00071                         bool hasAlphaChannel() const;
00073                         virtual void setFlag( texflag flag );
00075                         virtual bool loadTexture( std::string texname, texflag flag=TEX_NONE  );
00083                         virtual bool loadTexture( std::string texname, int id, GLuint texture_array[], texflag flag= TEX_NONE );                // use client memory
00090                         virtual bool loadTexture( std::string texname, int id , texflag flag= TEX_NONE );       // stored in TexArray with an ID
00091                         
00092 
00093         private:
00094                         // check if texture is already loaded
00095                         GLuint checkUsed( std::string texname );
00096 
00097                         GLuint m_id;
00098                         std::string m_texpath;
00099                         texflag m_texflag;
00100                         bool m_alpha;
00101                         static std::vector<std::string> TexList;
00102                         
00103                         
00104         };
00105 
00106 
00107         }//core
00108 }//ngn
00109 #endif /* _TEXTURE_H */

Généré le Fri Nov 19 14:20:29 2004 pour NGN par  doxygen 1.3.9.1