TazGraph Project v0.1.0
Loading...
Searching...
No Matches
Framebuffer.h
1#pragma once
2
3#include "../../GLSLProgram.h"
4
6{
7private:
8 float _rectangleVertices[24] =
9 {
10 // Coords // texCoords
11 1.0f, -1.0f, 1.0f, 0.0f,
12 -1.0f, -1.0f, 0.0f, 0.0f,
13 -1.0f, 1.0f, 0.0f, 1.0f,
14
15 1.0f, 1.0f, 1.0f, 1.0f,
16 1.0f, -1.0f, 1.0f, 0.0f,
17 -1.0f, 1.0f, 0.0f, 1.0f
18 };
19
20 unsigned int _rectVAO, _rectVBO;
21
22 unsigned int _FBO;
23 unsigned int _RBO;
24
25 unsigned int _multisampledFBO;
26 unsigned int _multisampledRBO;
27
28public:
29 bool _multisampleEnabled = false;
30 int _multisamples = 0;
31
32 static void SetMultisample(bool enable) {
33 if (enable) {
34 glEnable(GL_MULTISAMPLE);
35 }
36 else {
37 glDisable(GL_MULTISAMPLE);
38 }
39 }
40
41 uint32_t _framebufferTexture;
42 uint32_t _multisampledTexture;
43
44 int _width, _height;
45
48
49 void init(int windowWidth, int windowHeight, bool enableMSAA, int MSAA_samples = 0);
50
51 void attachMultisampleTexture(int windowWidth, int windowHeight);
52
53 void attachTexture(int windowWidth, int windowHeight);
54
55 void Bind();
56 void Unbind();
57};
Definition Framebuffer.h:6