Night Byte
Engine
Rendering
TextureManager.hpp
1
#pragma once
2
3
#include <SDL_render.h>
4
#include <SDL_image.h>
5
#include <map>
6
#include <string>
7
#include "../../API/Helpers/Vector2.hpp"
8
9
class
TextureManager
{
10
private
:
11
std::map<std::string, SDL_Texture*> TextureMap;
12
static
TextureManager
* instance;
13
public
:
14
~
TextureManager
();
15
SDL_Texture* getTexture(
std::string
textureId);
16
bool
CreateTexture(SDL_Surface * surface,
const
std::string
&textureId, SDL_Renderer* renderer);
17
bool
load(
const
std::string
&path,
const
std::string
& textureId);
18
void
draw(
std::string
&textureId,
int
x,
int
y,
int
w,
int
h,
double
scale,
double
r, SDL_Renderer* renderer, SDL_RendererFlip = SDL_FLIP_NONE);
19
20
void
drawFrame(
std::string
&
id
,
float
x,
float
y,
int
width,
int
height,
int
currentRow,
int
currentFrame,
21
SDL_Renderer *pRenderer, SDL_RendererFlip flip,
float
rotation);
22
23
void
drawFrame(
std::string
&
id
, SDL_Rect *srcRect,
float
x,
float
y, SDL_Renderer *pRenderer, SDL_RendererFlip flip,
24
float
scale = 1,
float
rotation = 0, SDL_FPoint *pivot =
nullptr
);
25
26
void
clearFromTextureMap(
const
std::string
&
id
);
27
Vector2
getDimensions(
const
std::string
&
id
);
28
static
TextureManager
* getInstance();
29
};
xml_schema::string
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
Definition:
common.hxx:255
TextureManager
Definition:
TextureManager.hpp:9
Vector2
Definition:
Vector2.hpp:7
Generated by
1.8.20