-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResourceManager.h
More file actions
42 lines (31 loc) · 833 Bytes
/
ResourceManager.h
File metadata and controls
42 lines (31 loc) · 833 Bytes
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
#ifndef RESOURCEMANAGER_H
#define RESOURCEMANAGER_H
#include <map>
#include <string>
#include <iostream>
#include "SDL.h"
#include "SDL_image.h"
#include "Texture.h"
#include "Animation.h"
#include "MultiTextureAnimation.h"
using namespace std;
// Loads resources, maps them to string IDs.
class ResourceManager
{
private:
SDL_Renderer* renderer;
map<string, Texture*> idToTexture;
map<string, Animation*> idToAnimation;
Texture* loadPNGTexture(string filepath);
public:
ResourceManager (SDL_Renderer* renderer);
~ResourceManager ();
Texture* getTexture(string id);
Animation* getAnimation(string id);
void loadTexture(string textureID, string filepath);
void addMultiTexAnimation(string* textureIDs,
float* delays,
int frameCount,
string animationID);
};
#endif