Index

zydeco / fractal

Experiment in graphics programming, C++, OpenGL, simulation techniques.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
1008 Dec 2023 15:215a717feFractal renderer update for articleJosh Stockin1129G

Blob @ zydeco / include / render / gl / GLTexture.hpp

text/plain690 bytesdownload raw
1#ifndef GLTEXTURE_HPP_
2#define GLTEXTURE_HPP_
3
4
5#include <map>
6#include "ZydecoCommon.hpp"
7
8
9class GLTexture
10{
11public:
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
23private:
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