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

@@ -2,10 +2,10 @@
#include "BehaviourScriptRegistry.hpp"
TSE::EDITOR::EditorSubsystem::EditorSubsystem() : sv(nullptr), rt({10,10}), editorLayer("")
TSE::EDITOR::EditorSubsystem::EditorSubsystem() : sv(nullptr), editorLayer("")
{
rt = TSE::GLFW::RenderTexture({100,100});
sv = SceneView(&rt);
rt = new TSE::GLFW::RenderTexture({100,100});
sv = SceneView(rt);
controller.AddGuiElement("Scene", &sv);
controller.AddGuiElement("Consol", &cv);
@@ -27,7 +27,7 @@ TSE::EDITOR::EditorSubsystem::EditorSubsystem() : sv(nullptr), rt({10,10}), edit
Transformable* editorCamera = new Transformable(".EditorCamera");
Camera* editorCam = new Camera();
editorCam->SetRenderTarget(&rt);
editorCam->SetRenderTarget(rt);
editorCamera->AddBehaviourScript(editorCam);
// basicCameraControls controls = basicCameraControls();

View File

@@ -20,7 +20,7 @@ namespace TSE::EDITOR
HirearchieView hv = HirearchieView(nullptr);
PropertiesView pv;
CameraView camv;
TSE::GLFW::RenderTexture rt;
TSE::GLFW::RenderTexture* rt;
SceneView sv;
Layer editorLayer;

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;