00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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 ];
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 );
00090 virtual bool loadTexture( std::string texname, int id , texflag flag= TEX_NONE );
00091
00092
00093 private:
00094
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 }
00108 }
00109 #endif