added rest of the openGL implementation theoreticaly the engine can render now
This commit is contained in:
54
TSE_GlfwOpenGlImpl/src/RenderTexture.cpp
Normal file
54
TSE_GlfwOpenGlImpl/src/RenderTexture.cpp
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user