1 | #ifndef GLTEXTURE_HPP_ |
2 | #define GLTEXTURE_HPP_ |
3 |
|
4 |
|
5 | #include <map> |
6 | #include "ZydecoCommon.hpp" |
7 |
|
8 |
|
9 | class GLTexture |
10 | { |
11 | public: |
12 | static GLTexture& GetGLTexture(std::string name); |
13 |
|
14 | GLTexture(std::string texture_name, void *data_source, uint32_t width, uint32_t height); |
15 | ~GLTexture(); |
16 |
|
17 | void Regenerate(int width, int height); |
18 | void Bind(uint64_t texture_unit); |
19 |
|
20 | uint32_t m_glTextureID; |
21 | private: |
22 | static std::map<std::string, GLTexture*> s_textures; |
23 |
|
24 | bool m_doRegen = false; |
25 | std::string m_name; |
26 | void *m_pDataSource; |
27 | uint32_t m_width; |
28 | uint32_t m_height; |
29 | }; |
30 |
|
31 |
|
32 | #endif /* GLTEXTURE_HPP_ */ |
33 |
|