00001 00002 00003 #ifndef TEXTURE_H 00004 #define TEXTURE_H 00005 00006 00007 #include <string> 00008 00009 //#include "Renderer.h" 00010 #include "glew.h" 00011 00012 00013 namespace pge { 00014 00015 class Image; 00016 00017 class Texture { 00018 00019 00020 public: 00021 //************************************************************************ 00022 // 00023 // Constructor 00024 // 00025 //************************************************************************ 00027 Texture(Image *image, const std::string &name); 00028 00030 //Texture(const Texture &c); 00031 00032 00033 //************************************************************************ 00034 // 00035 // Destructor 00036 // 00037 //************************************************************************ 00039 ~Texture(void); 00040 00041 00042 //************************************************************************ 00043 // 00044 // Functions 00045 // 00046 //************************************************************************ 00047 GLuint getDescriptor(void); 00048 std::string getName(void); 00049 void setName(const std::string &name); 00050 void createTexture2D(bool mipmap, GLuint minFilter, GLuint magFilter, GLuint wrapS, GLuint wrapT); 00051 00052 void bind(void); 00053 00054 void setAlphaBlending(bool alphaEnabled) { 00055 m_alphaBlending = alphaEnabled; 00056 } 00057 00058 bool hasAlphaBlending(void) { 00059 return m_alphaBlending; 00060 } 00061 00062 int getWidth(void) { 00063 return this->m_width; 00064 } 00065 00066 int getHeight(void) { 00067 return this->m_height; 00068 } 00069 00070 00071 private: 00072 //************************************************************************ 00073 // 00074 // Variables 00075 // 00076 //************************************************************************ 00077 std::string m_name; 00078 GLuint m_descriptor; 00079 int m_width; 00080 int m_height; 00081 Image *m_image; 00082 bool m_alphaBlending; 00083 }; 00084 }; 00085 00086 #endif