added rest of the openGL implementation theoreticaly the engine can render now

This commit is contained in:
2026-01-17 23:04:56 +01:00
parent 0f8c21278a
commit 551b790243
31 changed files with 1648 additions and 6 deletions

View File

@@ -0,0 +1,54 @@
#include "RenderTexture.hpp"
TSE::GLFW::RenderTexture::RenderTexture(Vector2 v) : buffer(v)
{
buffer.AddResizeNotifiable(this);
}
TSE::Vector2 TSE::GLFW::RenderTexture::size() const
{
return buffer.GetSize();
}
void TSE::GLFW::RenderTexture::SetSize(Vector2 v)
{
buffer.Resize(v);
}
float TSE::GLFW::RenderTexture::width() const
{
return buffer.GetSize().x;
}
float TSE::GLFW::RenderTexture::height() const
{
return buffer.GetSize().y;
}
uint TSE::GLFW::RenderTexture::GetTextureId() const
{
return buffer.GetTextureId();
}
void TSE::GLFW::RenderTexture::Update()
{
buffer.Update();
}
void TSE::GLFW::RenderTexture::Bind()
{
buffer.Bind();
}
void TSE::GLFW::RenderTexture::Unbind()
{
buffer.Unbind();
}
void TSE::GLFW::RenderTexture::OnResize(float width, float height, IResizable *wnd)
{
for (auto const& i : objectsToResize)
{
i->OnResize(width, height, this);
}
}