UGDK
|
00001 #ifndef UGDK_GRAPHIC_TEXTURE_H_ 00002 #define UGDK_GRAPHIC_TEXTURE_H_ 00003 00004 #include <string> 00005 #include "SDL_opengl.h" 00006 #include "SDL_video.h" 00007 00008 namespace ugdk { 00009 namespace graphic { 00010 00011 class Texture { 00012 public: 00013 ~Texture(); 00014 static Texture* CreateFromFile(const std::string& filepath); 00015 static Texture* CreateFromSurface(SDL_Surface* data); 00016 static Texture* CreateRawTexture(int texture_width, int texture_height); 00017 00018 GLuint gltexture() const { return gltexture_; } 00019 const int width() const { return texture_width_; } 00020 const int height() const { return texture_height_; } 00021 00022 private: 00023 Texture(GLuint gltexture, int texture_width, int texture_height); 00024 00025 GLuint gltexture_; 00026 int texture_width_, texture_height_; 00027 }; 00028 00029 } // namespace graphic 00030 } // namespace ugdk 00031 00032 #endif