PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
Texture.hpp
Go to the documentation of this file.
1 #ifndef TEXTURE_HPP
2 #define TEXTURE_HPP
3 
4 #include <stdio.h>
5 #include <SDL2/SDL.h>
6 #include <SDL2/SDL_image.h>
7 
8 namespace pk
9 {
10 
16 class Texture
17 {
18  public:
19 
24  Texture();
25  virtual ~Texture();
26 
33  bool loadTexture(const char *path, SDL_Renderer * const renderTarget);
34 
40  bool loadTexture(SDL_Texture * const texture);
41 
47  SDL_Texture * getTexture(){return m_texture;};
48 
54  int getWidth(){ return m_width; };
55 
61  int getHeight(){ return m_height; };
62 
63 
64  private:
65  SDL_Texture* m_texture;
66  int m_width;
67  int m_height;
68 };
69 
70 } //end namespace pk
71 
72 #endif // TEXTURE_HPP
bool loadTexture(const char *path, SDL_Renderer *const renderTarget)
Definition: Game.hpp:7
virtual ~Texture()
SDL_Texture * getTexture()
Get the SDL_Texture from the Texture.
Definition: Texture.hpp:47
int m_width
The width of the Texture in pixels.
Definition: Texture.hpp:66
SDL_Texture * m_texture
Pointer to the SDL_Texture data.
Definition: Texture.hpp:61
Texture()
Default constructor.
int getHeight()
Get the height of the SDL_Texture.
Definition: Texture.hpp:61
int getWidth()
Get the width of the SDL_Texture.
Definition: Texture.hpp:54
int m_height
The height of the Texture in pixels.
Definition: Texture.hpp:67
A class implemented using the Facade pattern used for loading SDL_Texture data.
Definition: Texture.hpp:16