added rest of the openGL implementation theoreticaly the engine can render now
This commit is contained in:
32
TSE_GlfwOpenGlImpl/src/buffer/FrameBuffer.hpp
Normal file
32
TSE_GlfwOpenGlImpl/src/buffer/FrameBuffer.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user