blob: 503dcef76e4db2cdf438badd925e8c2e64e2361d (
plain)
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
|
#pragma once
#include "Resource.h"
#include "SDL_rect.h"
#include "SDL_render.h"
#include <memory>
namespace crepe::api {
class Spritesheet{
public:
Spritesheet(const char * src, const int row , const int col);
Spritesheet(std::unique_ptr<api::Resource> res, const int row, const int col);
~Spritesheet();
void select_sprite(const int x, const int y);
void draw_selected_sprite(const int x, const int y);
private:
void load(std::unique_ptr<api::Resource> res, const int row, const int col);;
SDL_Texture* get_texture() const;
private:
SDL_Texture* m_spritesheet;
SDL_Rect m_clip;
};
}
|