UGDK  0.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
texture.h
Go to the documentation of this file.
1 #ifndef UGDK_GRAPHIC_TEXTURE_H_
2 #define UGDK_GRAPHIC_TEXTURE_H_
3 
4 #include <string>
5 #include "SDL_opengl.h"
6 #include "SDL_video.h"
7 
8 namespace ugdk {
9 namespace graphic {
10 
11 class Texture {
12  public:
13  ~Texture();
14  static Texture* CreateFromFile(const std::string& filepath);
15  static Texture* CreateFromSurface(SDL_Surface* data);
16  static Texture* CreateRawTexture(int texture_width, int texture_height);
17 
18  GLuint gltexture() const { return gltexture_; }
19  const int width() const { return texture_width_; }
20  const int height() const { return texture_height_; }
21 
22  private:
23  Texture(GLuint gltexture, int texture_width, int texture_height);
24 
25  GLuint gltexture_;
26  int texture_width_, texture_height_;
27 };
28 
29 } // namespace graphic
30 } // namespace ugdk
31 
32 #endif