forked from MetaCipher/the-sdl-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Texture.h
44 lines (31 loc) · 849 Bytes
/
Texture.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//==============================================================================
/*
Texture class for wrapping SDL Textures
3/13/2014
SDLTutorials.com
Tim Jones
*/
//==============================================================================
#ifndef __TEXTURE_H__
#define __TEXTURE_H__
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <string>
class Texture {
private:
std::string Filename;
int Width = 0;
int Height = 0;
SDL_Renderer* Renderer = NULL;
SDL_Texture* SDLTexture = NULL;
public:
Texture();
~Texture();
bool Load(SDL_Renderer* Renderer, std::string Filename);
void Render(int X, int Y);
void Render(int X, int Y, int Width, int Height);
void Render(int X, int Y, int Width, int Height, int SX, int SY, int SWidth, int SHeight);
int GetWidth();
int GetHeight();
};
#endif