33 lines
714 B
C++
33 lines
714 B
C++
#pragma once
|
|
|
|
#include "buffer.hpp"
|
|
#include "interfaces/IResizable.hpp"
|
|
#include "Vector2.hpp"
|
|
|
|
namespace TSE::GLFW
|
|
{
|
|
class FrameBuffer : public buffer, public IResizable
|
|
{
|
|
private:
|
|
uint textureID = 0;
|
|
uint depthRboID = 0;
|
|
Vector2 size;
|
|
bool shouldResize = false;
|
|
|
|
public:
|
|
FrameBuffer(const Vector2& size);
|
|
void Bind() override;
|
|
void Unbind() override;
|
|
~FrameBuffer() override;
|
|
void Resize(Vector2 size);
|
|
void Update();
|
|
uint GetTextureId() const;
|
|
Vector2 GetSize() const;
|
|
|
|
private:
|
|
void Initialize();
|
|
void LoadFBTexture();
|
|
void CreateFBTexture();
|
|
};
|
|
} // namespace TSE
|