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 | GLTexture(uint32_t sized_format, void *data_source, uint32_t width, uint32_t height); |
13 | ~GLTexture(); |
14 |
|
15 | uint32_t GetID(); |
16 |
|
17 | void SetDataSourceAndReload(void *data_source, int width, int height); |
18 | void ReloadFromDataSource(); |
19 |
|
20 | void BindAsTexture(uint64_t texture_unit); |
21 | void BindAsImage(uint64_t texture_unit); |
22 |
|
23 | private: |
24 | uint32_t m_glTextureID = 0; |
25 | uint32_t m_baseFormat = 0; |
26 | uint32_t m_sizedFormat = 0; |
27 | uint32_t m_dataType = 0; |
28 |
|
29 | void *m_pDataSource; |
30 | uint32_t m_width; |
31 | uint32_t m_height; |
32 | }; |
33 |
|
34 |
|
35 | #endif /* GLTEXTURE_HPP_ */ |
36 |
|