forked from zfteam/rs97-commander-sdl2
-
Notifications
You must be signed in to change notification settings - Fork 4
/
resourceManager.h
executable file
·52 lines (39 loc) · 1020 Bytes
/
resourceManager.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
#ifndef _RESOURCEMANAGER_H_
#define _RESOURCEMANAGER_H_
#include <SDL.h>
#include <SDL_ttf.h>
#define NB_SURFACES 8
class CResourceManager
{
public:
typedef enum
{
T_SURFACE_FOLDER = 0,
T_SURFACE_FILE,
T_SURFACE_FILE_IMAGE,
T_SURFACE_FILE_INSTALLABLE_PACKAGE,
T_SURFACE_FILE_PACKAGE,
T_SURFACE_UP,
T_SURFACE_CURSOR1,
T_SURFACE_CURSOR2
}
T_SURFACE;
// Method to get the instance
static CResourceManager& instance(void);
// Cleanup all resources
void sdlCleanup(void);
// Get a loaded surface
SDL_Surface *getSurface(const T_SURFACE p_surface) const;
// Get the loaded font
TTF_Font *getFont(void) const;
private:
// Forbidden
CResourceManager(void);
CResourceManager(const CResourceManager &p_source);
const CResourceManager &operator =(const CResourceManager &p_source);
// Images
SDL_Surface *m_surfaces[NB_SURFACES];
// Font
TTF_Font *m_font;
};
#endif