Removing big memory hog from renderer

This commit is contained in:
2022-12-21 19:11:27 +01:00
parent a1ec94e983
commit e7f1bd7d52
5 changed files with 142 additions and 82 deletions

View File

@ -125,25 +125,11 @@ public:
class Viewport : EditorWindow {
public:
Viewport (Scene& scene) : EditorWindow("SceneView") {
Framebuffer framebuffer = Framebuffer((int)ImGui::GetWindowWidth(),(int)ImGui::GetWindowHeight());
Renderer renderer = Renderer();
renderer.Prepare(scene);
renderer.Render(&framebuffer, scene);
Viewport (Framebuffer& fb) : EditorWindow("SceneView") {
ImGui::Image(
(void*)(intptr_t)framebuffer.GetColourAttachment(),
(void*)(intptr_t)fb.GetColourAttachment(),
ImVec2{ (float)ImGui::GetWindowWidth(),(float)ImGui::GetWindowHeight() }
);
//ImGuizmo::SetDrawlist();
//ImGuizmo::SetRect(ImGui::GetWindowPos().x, ImGui::GetWindowPos().y, ImGui::GetWindowWidth(), ImGui::GetWindowHeight());