-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLTexture.h
57 lines (39 loc) · 1.03 KB
/
LTexture.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
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include "Global.h"
class LTexture
{
private:
// Texture stored on hardware
SDL_Texture* mTexture;
SDL_Renderer* textureRenderer;
// Image Coordinates
int xPosition;
int yPosition;
// Image dimensions
int mWidth;
int mHeight;
// Image offset
int offsetX;
int offsetY;
float scale;
public:
LTexture();
~LTexture();
bool LoadFromFile(SDL_Renderer* renderer, const char* path);
bool LoadFromRenderedText(SDL_Renderer* renderer, const char* text, SDL_Color textColor, const char* fontPath, int size);
void Free();
void Render(int x, int y, SDL_Rect* clip = NULL, double* angle = nullptr, SDL_Point* center = NULL, SDL_RendererFlip flip = SDL_FLIP_NONE);
int GetWidth();
int GetHeight();
int GetXPos();
int GetYPos();
void SetOffsetX(int value);
void SetOffsetY(int value);
void SetScale(double value);
// Set color modulation
void SetColor(Uint8 red, Uint8 green, Uint8 blue);
// Set Blending
void SetBlendMode(SDL_BlendMode blending);
// Set alpha modulation
void SetAlpha(Uint8 alpha);
};