blob: 39de064799d91c8f686473e2dfa8b1cf2d154a79 (
plain)
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
|
#pragma once
#include <cstdint>
namespace dp
{
class OGLContext;
class Framebuffer
{
public:
Framebuffer() = default;
~Framebuffer();
void SetDefaultContext(dp::OGLContext * context);
void SetSize(uint32_t width, uint32_t height);
void Enable();
void Disable();
uint32_t GetTextureId() const;
bool IsSupported() const { return m_isSupported; }
private:
void Destroy();
uint32_t m_width = 0;
uint32_t m_height = 0;
uint32_t m_colorTextureId = 0;
uint32_t m_depthTextureId = 0;
uint32_t m_framebufferId = 0;
dp::OGLContext * m_defaultContext = 0;
bool m_isSupported = true;
};
} // namespace dp
|