1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef FRAMEBUFFER_H
- #define FRAMEBUFFER_H
- #include <GL/glew.h>
- #include <array>
- #include "common/utils/Types.h"
- class Framebuffer final
- {
- public:
- static const u32 POSITION = 1;
- static const u32 NORMAL = 2;
- static const u32 COLOR = 4;
- static const u32 RED = 8;
- static const u32 DEPTH24_STENCIL8 = 16;
-
- Framebuffer(u32 width, u32 height, u32 mode);
- ~Framebuffer();
-
- bool isValid() const;
- void bind() const;
-
- void resize(u32 width, u32 height) const;
-
- void bindPositionTexture(u32 textureUnit) const;
- void bindNormalTexture(u32 textureUnit) const;
- void bindColorTexture(u32 textureUnit) const;
- void bindRedTexture(u32 textureUnit) const;
- void bindDepthTexture(u32 textureUnit) const;
-
- private:
- Framebuffer(const Framebuffer& other) = delete;
- Framebuffer(Framebuffer&& other) = delete;
- Framebuffer& operator=(const Framebuffer& other) = delete;
- Framebuffer& operator=(Framebuffer&& other) = delete;
- u32 mode;
- std::array<GLuint, 5> textures;
- GLuint buffer;
- bool valid;
- };
- #endif
|