made the editor work by debugging on windows

This commit is contained in:
2026-01-18 16:49:45 +01:00
parent b73d09f09f
commit 23e7707122
11 changed files with 41 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
#include "ViewportController.hpp"
#include "imgui/imgui.h"
#include <chrono>
extern "C" {
#include "tinyfiledialogs.h"

View File

@@ -1,7 +1,9 @@
#include "CameraView.hpp"
TSE::EDITOR::CameraView::CameraView() : GuiWindow("Camera", ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar)
, fb({100,100}) { }
{
fb = new TSE::GLFW::RenderTexture({100,100});
}
void TSE::EDITOR::CameraView::Define()
{
@@ -11,18 +13,17 @@ void TSE::EDITOR::CameraView::Define()
currentCamera->SetRenderTarget(nullptr);
currentCamera = Camera::mainCamera;
if(currentCamera != nullptr)
currentCamera->SetRenderTarget(&fb);
currentCamera->SetRenderTarget(fb);
}
ImGuiWindowFlags flags2 = ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar;
if(ImGui::BeginChild("##SceneChild", {0,0}, ImGuiChildFlags_None, flags2))
{
float w = fb.width();
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});
fb->SetSize({vec2.x, vec2.y});
}
}
ImGui::EndChild();

View File

@@ -10,7 +10,7 @@ namespace TSE::EDITOR
{
private:
Camera* currentCamera = nullptr;
TSE::GLFW::RenderTexture fb;
TSE::GLFW::RenderTexture* fb;
public:
CameraView();
void Define() override;