-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssetManager.h
More file actions
executable file
·51 lines (31 loc) · 1.03 KB
/
AssetManager.h
File metadata and controls
executable file
·51 lines (31 loc) · 1.03 KB
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
//
// Created by segalle on 02/11/2021.
//
#ifndef JOGO_ASSETMANAGER_H
#define JOGO_ASSETMANAGER_H
#include <SFML/Graphics.hpp>
#include <map>
#include <string>
#include <iostream>
class AssetManager {
private:
//é necessário carregar texturas antes de torna-las sprites
std::map<std::string, sf::Sprite*> sprites;
std::map<std::string, sf::Font*> fonts;
std::map<std::string, sf::Texture*> textures;
std::map<std::string, sf::Sprite*>::iterator itS;
std::map<std::string, sf::Font*>::iterator itF;
std::map<std::string, sf::Texture*>::iterator itT;
sf::Texture* texture;
sf::Font* font;
sf::Sprite* sprite;
public:
AssetManager();
~AssetManager();
void loadSprite(std::string path = "../Resources/Textures/Failed.jpg", std::string name = "failed");
sf::Sprite* getSprite(std::string name = "failed");
sf::Sprite* operator[](std::string name);
void loadFont(std::string path, std::string name);
sf::Font* getFont(std::string name);
};
#endif //JOGO_ASSETMANAGER_H