made Editor non reliant on GLFW aka i added an IRenderTexture interface of use in non renderer specific aplications

This commit is contained in:
2026-01-18 18:49:15 +01:00
parent 23e7707122
commit a453612b9a
17 changed files with 87 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
#include "SceneView.hpp"
TSE::EDITOR::SceneView::SceneView(TSE::GLFW::RenderTexture *frameBuffer) : GuiWindow("Scene", ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar)
TSE::EDITOR::SceneView::SceneView(TSE::IRenderTexture *frameBuffer) : GuiWindow("Scene", ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar)
{
fb = frameBuffer;
}
@@ -10,9 +10,9 @@ void TSE::EDITOR::SceneView::Define()
ImGuiWindowFlags flags2 = ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar;
if(ImGui::BeginChild("##SceneChild", {0,0}, ImGuiChildFlags_None, flags2))
{
ImGui::Image(fb->GetTextureId(), {fb->width(), fb->height()},{0,1}, {1,0});
ImGui::Image(fb->GetTextureId(), {fb->Width(), fb->Height()},{0,1}, {1,0});
auto vec2 = ImGui::GetWindowSize();
if(fb->width() != vec2.x || fb->height() != vec2.y)
if(fb->Width() != vec2.x || fb->Height() != vec2.y)
{
fb->SetSize({vec2.x, vec2.y});
}