-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnglResourceManager.h
64 lines (38 loc) · 1.2 KB
/
nglResourceManager.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
53
54
55
56
57
58
59
60
61
62
63
64
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <glm/glm.hpp>
#include "nglCommon.h"
#include "nglMesh.h"
#include <map>
#ifndef nglResourceManager_h__
#define nglResourceManager_h__
namespace ngl {
using namespace scene;
class ResourceManager {
public:
ResourceManager(char* dir_shaders, char* dir_models, char* dir_textures, char* dir_heightmaps, char* dir_guis);
virtual ~ResourceManager();
nglShaderProgram* GetShaderProgram(char* name);
nglTexture* GetTexture(char* name);
private:
//root directory of executable, with full path
std::string _dir_root;
//relative root directory for various data
std::string _dir_shaders;
std::string _dir_models;
std::string _dir_textures;
std::string _dir_heightmaps;
std::string _dir_guis;
std::string _directory_seperator;
std::vector<Mesh*> _meshes;
std::map<std::string, nglShaderProgram*> _shaders;
std::map<std::string, nglTexture*> _textures;
//gets root path under windows.
//example : "C:/application"
std::string GetRootPath();
//nglShaderBuilder _shader_builder;
//cached resources
};
}
#endif // nglResourceManager_h__