From c62f3615d493a734e2567433bcc0da5a2d6c1634 Mon Sep 17 00:00:00 2001 From: Nigel Barink Date: Thu, 3 Nov 2022 15:06:42 +0100 Subject: [PATCH] Redering cube in editor --- BarinkEngine/src/BarinkEngine.cpp | 2 +- BarinkEngine/src/GUI/GUIManager.cpp | 10 ++ BarinkEngine/src/Graphics/Memory/Buffer.cpp | 12 +- BarinkEngine/src/Graphics/Memory/Buffer.h | 8 +- .../src/Graphics/Memory/FrameBuffer.cpp | 36 ++++- .../src/Graphics/Memory/Framebuffer.h | 11 +- .../src/Graphics/Memory/UniformBuffer.cpp | 31 +++++ .../src/Graphics/Memory/UniformBuffer.h | 15 +++ BarinkEngine/src/Graphics/RenderSurface.h | 4 +- BarinkEngine/src/Graphics/Renderer.cpp | 24 +++- BarinkEngine/src/Graphics/Renderer.h | 2 +- BarinkEngine/{ => src}/PerfCounter.cpp | 4 +- BarinkEngine/src/Scene/Scene.cpp | 1 + Editor/premake5.lua | 8 +- Editor/src/main.cpp | 124 ++++++++---------- Editor/src/widgets/widgets.h | 79 +++++++++++ 16 files changed, 271 insertions(+), 100 deletions(-) create mode 100644 BarinkEngine/src/Graphics/Memory/UniformBuffer.cpp create mode 100644 BarinkEngine/src/Graphics/Memory/UniformBuffer.h rename BarinkEngine/{ => src}/PerfCounter.cpp (91%) create mode 100644 Editor/src/widgets/widgets.h diff --git a/BarinkEngine/src/BarinkEngine.cpp b/BarinkEngine/src/BarinkEngine.cpp index 59e2036..1ece7d0 100644 --- a/BarinkEngine/src/BarinkEngine.cpp +++ b/BarinkEngine/src/BarinkEngine.cpp @@ -8,7 +8,7 @@ int main(int argc, char* argv[]) { EngineInstrumentation::PerfomanceSamplerInit(); // Startup services - BarinkWindow MainWindow = BarinkWindow(800, 600); + BarinkWindow MainWindow = BarinkWindow(1200, 700); renderer = BarinkEngine::Renderer(); InputSystem = BarinkEngine::InputManager(); diff --git a/BarinkEngine/src/GUI/GUIManager.cpp b/BarinkEngine/src/GUI/GUIManager.cpp index 5308d66..ebb5fa0 100644 --- a/BarinkEngine/src/GUI/GUIManager.cpp +++ b/BarinkEngine/src/GUI/GUIManager.cpp @@ -2,6 +2,7 @@ #include "imgui.h" #include "backends/imgui_impl_opengl3.h" #include +#include "../../libs/guizmo/ImGuizmo.h" #include "../BarinkEngine.h" GUIManager::GUIManager(BarinkWindow* window) @@ -35,8 +36,17 @@ void GUIManager::Render() ImGui::NewFrame(); + ImGuizmo::SetOrthographic(true); + ImGuizmo::BeginFrame(); + + ImmediateGraphicsDraw(); + + + + ImGui::EndFrame(); + ImGui::Render(); ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); diff --git a/BarinkEngine/src/Graphics/Memory/Buffer.cpp b/BarinkEngine/src/Graphics/Memory/Buffer.cpp index a55503e..d1fb554 100644 --- a/BarinkEngine/src/Graphics/Memory/Buffer.cpp +++ b/BarinkEngine/src/Graphics/Memory/Buffer.cpp @@ -1,15 +1,15 @@ #include "Buffer.h" -int GpuBuffer::getBufferID() { +int Buffer::getBufferID() { return id; } -void GpuBuffer::createBuffer() { +void Buffer::createBuffer() { glGenBuffers(1, (GLuint*) &id); } -void GpuBuffer::setBufferData(void* data, size_t dataSize, bool elementBuffer = false ) { +void Buffer::setBufferData(void* data, size_t dataSize, bool elementBuffer = false ) { if (elementBuffer) { glBufferData(GL_ELEMENT_ARRAY_BUFFER, dataSize, data, GL_STATIC_DRAW); @@ -21,7 +21,7 @@ void GpuBuffer::setBufferData(void* data, size_t dataSize, bool elementBuffer = } -void GpuBuffer::Bind(bool elementBuffer = false ) { +void Buffer::Bind(bool elementBuffer = false ) { if (elementBuffer) { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, id); @@ -32,7 +32,7 @@ void GpuBuffer::Bind(bool elementBuffer = false ) { } } -void GpuBuffer::Unbind(bool elementBuffer = false) { +void Buffer::Unbind(bool elementBuffer = false) { if (elementBuffer) { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } @@ -42,6 +42,6 @@ void GpuBuffer::Unbind(bool elementBuffer = false) { } } -void GpuBuffer::Delete() { +void Buffer::Delete() { glDeleteBuffers(1, (GLuint*) &id); } \ No newline at end of file diff --git a/BarinkEngine/src/Graphics/Memory/Buffer.h b/BarinkEngine/src/Graphics/Memory/Buffer.h index 196693f..f4e8816 100644 --- a/BarinkEngine/src/Graphics/Memory/Buffer.h +++ b/BarinkEngine/src/Graphics/Memory/Buffer.h @@ -1,8 +1,7 @@ #pragma once #include -class GpuBuffer { -private: - unsigned int id; +class Buffer { + public: int getBufferID(); @@ -16,4 +15,7 @@ public: void Delete(); +private: + unsigned int id; + }; \ No newline at end of file diff --git a/BarinkEngine/src/Graphics/Memory/FrameBuffer.cpp b/BarinkEngine/src/Graphics/Memory/FrameBuffer.cpp index 3b131f7..d57281f 100644 --- a/BarinkEngine/src/Graphics/Memory/FrameBuffer.cpp +++ b/BarinkEngine/src/Graphics/Memory/FrameBuffer.cpp @@ -9,24 +9,44 @@ Framebuffer::Framebuffer() // Create a colour texture! glGenTextures(1, &ColourAttachment); glBindTexture(GL_TEXTURE_2D, ColourAttachment); - glTexImage2D(GL_TEXTURE_2D, 1, GL_RGB, 800, 600, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 800, 600, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + glBindTexture(GL_TEXTURE_2D, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, ColourAttachment, 0); - glBindTexture(GL_TEXTURE_2D, 0); + // Create a depth buffer - glGenRenderbuffers(1, &DepthAttachment); - glBindRenderbuffer(GL_RENDERBUFFER, DepthAttachment); + glGenTextures(1, &DepthAttachment); + glBindTexture(GL_TEXTURE_2D, DepthAttachment); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 800, 600); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, 800, 600, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL); + + glBindTexture(GL_TEXTURE_2D, 0); - glFramebufferRenderbuffer(GL_RENDERBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, DepthAttachment); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, DepthAttachment, 0); - glBindRenderbuffer(GL_RENDERBUFFER, 0); + + /* + * // Render buffer + glGenRenderbuffers(1, &DepthAttachment); + glBindRenderbuffer(GL_RENDERBUFFER, DepthAttachment); + + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 800, 600); + + + glBindRenderbuffer(GL_RENDERBUFFER, 0); + + glFramebufferRenderbuffer(GL_RENDERBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, DepthAttachment); + + */ + + @@ -39,6 +59,8 @@ Framebuffer::Framebuffer() } glBindFramebuffer(GL_FRAMEBUFFER, 0); + + } Framebuffer::~Framebuffer() diff --git a/BarinkEngine/src/Graphics/Memory/Framebuffer.h b/BarinkEngine/src/Graphics/Memory/Framebuffer.h index ee444e6..56ac4d9 100644 --- a/BarinkEngine/src/Graphics/Memory/Framebuffer.h +++ b/BarinkEngine/src/Graphics/Memory/Framebuffer.h @@ -8,13 +8,14 @@ public: Framebuffer(); ~Framebuffer(); - unsigned int GetId() { return Id; } - unsigned int GetColourAttachment() { return ColourAttachment; } + GLuint GetId() { return Id; } + GLuint GetColourAttachment() { return ColourAttachment; } + GLuint GetDepthAttachment() { return DepthAttachment; } private: - unsigned int Id = 0; - unsigned int ColourAttachment = 0; - unsigned int DepthAttachment = 0; + GLuint Id = 0; + GLuint ColourAttachment = 0; + GLuint DepthAttachment = 0; }; \ No newline at end of file diff --git a/BarinkEngine/src/Graphics/Memory/UniformBuffer.cpp b/BarinkEngine/src/Graphics/Memory/UniformBuffer.cpp new file mode 100644 index 0000000..e969ba3 --- /dev/null +++ b/BarinkEngine/src/Graphics/Memory/UniformBuffer.cpp @@ -0,0 +1,31 @@ +#include "UniformBuffer.h" +#include +UniformBuffer::UniformBuffer(unsigned int size) +{ + glGenBuffers(1, &Id ); + glBindBuffer(GL_ARRAY_BUFFER, Id); + glBufferData(GL_ARRAY_BUFFER, size, nullptr, GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); +} + +UniformBuffer::~UniformBuffer() +{ + glDeleteBuffers(1, &Id); +} + + +void UniformBuffer::setData( unsigned int offset , unsigned int size , void* data) +{ + glBindBuffer(GL_ARRAY_BUFFER, Id); + glBufferSubData(GL_ARRAY_BUFFER, offset , size, data); + glBindBuffer(GL_ARRAY_BUFFER, 0); +} + +void UniformBuffer::setDescriptor(unsigned int index, unsigned int size , unsigned int stride, void* pointer) +{ + glBindBuffer(GL_ARRAY_BUFFER, Id); + glVertexAttribPointer(index, size, GL_FLOAT, GL_FALSE, stride, pointer); + glBindBuffer(GL_ARRAY_BUFFER, 0); +} + + diff --git a/BarinkEngine/src/Graphics/Memory/UniformBuffer.h b/BarinkEngine/src/Graphics/Memory/UniformBuffer.h new file mode 100644 index 0000000..b44e587 --- /dev/null +++ b/BarinkEngine/src/Graphics/Memory/UniformBuffer.h @@ -0,0 +1,15 @@ +#pragma once + +class UniformBuffer { +public: + + UniformBuffer (unsigned int size); + ~UniformBuffer(); + void setData(unsigned int offset, unsigned int size, void* data); + void setDescriptor(unsigned int index, unsigned int size, unsigned int stride, void* pointer); + + +private: + unsigned int Id; + +}; \ No newline at end of file diff --git a/BarinkEngine/src/Graphics/RenderSurface.h b/BarinkEngine/src/Graphics/RenderSurface.h index 545afe9..2805b8b 100644 --- a/BarinkEngine/src/Graphics/RenderSurface.h +++ b/BarinkEngine/src/Graphics/RenderSurface.h @@ -22,8 +22,8 @@ private: std::vector indices; - GpuBuffer vertexBuffer; - GpuBuffer elementBuffer; + Buffer vertexBuffer; + Buffer elementBuffer; VertexArray VAO; diff --git a/BarinkEngine/src/Graphics/Renderer.cpp b/BarinkEngine/src/Graphics/Renderer.cpp index b50dfd8..d520809 100644 --- a/BarinkEngine/src/Graphics/Renderer.cpp +++ b/BarinkEngine/src/Graphics/Renderer.cpp @@ -16,8 +16,8 @@ void BarinkEngine::Renderer::Prepare(Scene& scene ) { auto group = scene.getReg().view(); group.each([](auto enity, BarinkEngine::Render3DComponent& renderComponent) { VertexArray va = VertexArray(); - GpuBuffer vertexBuffer = GpuBuffer(); - GpuBuffer elementBuffer = GpuBuffer(); + Buffer vertexBuffer = Buffer(); + Buffer elementBuffer = Buffer(); va.Create(); va.Bind(); @@ -45,6 +45,8 @@ void BarinkEngine::Renderer::Prepare(Scene& scene ) { }); } + + void BarinkEngine::Renderer::Render(Scene& scene) { auto group = scene.getReg().view(); @@ -66,7 +68,7 @@ void BarinkEngine::Renderer::Render(Scene& scene) renderComponent.shader.setUniformMat4("V", cam.GetViewMatrix()); renderComponent.shader.setUniformMat4("P", projection); - + //std::cout << "Draw " << renderComponent.mesh.elements.size() << " elements" << std::endl; glDrawElements(GL_TRIANGLES, static_cast(renderComponent.mesh.elements.size()) , GL_UNSIGNED_INT, NULL); @@ -75,5 +77,17 @@ void BarinkEngine::Renderer::Render(Scene& scene) } -void Render(Framebuffer& framebuffer) -{} \ No newline at end of file +void BarinkEngine::Renderer::Render(Framebuffer& framebuffer, Scene& scene) +{ + + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.GetId()); + + glClearColor(.5f, .0f, .5f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + Render(scene); + glBindFramebuffer(GL_FRAMEBUFFER, 0); +} + + + diff --git a/BarinkEngine/src/Graphics/Renderer.h b/BarinkEngine/src/Graphics/Renderer.h index f9c3366..046f9ab 100644 --- a/BarinkEngine/src/Graphics/Renderer.h +++ b/BarinkEngine/src/Graphics/Renderer.h @@ -22,6 +22,6 @@ namespace BarinkEngine { void Prepare(Scene& scene); void Render(Scene& scene ); - void Render(Framebuffer& framebuffer); + void Render(Framebuffer& framebuffer, Scene& scene); }; } diff --git a/BarinkEngine/PerfCounter.cpp b/BarinkEngine/src/PerfCounter.cpp similarity index 91% rename from BarinkEngine/PerfCounter.cpp rename to BarinkEngine/src/PerfCounter.cpp index 8774e35..55e2368 100644 --- a/BarinkEngine/PerfCounter.cpp +++ b/BarinkEngine/src/PerfCounter.cpp @@ -1,4 +1,4 @@ -#include "src/PerfCounter.h" +#include "PerfCounter.h" #include #include @@ -66,5 +66,5 @@ void PerfSampler::Stop() auto ms = durationInuSeconds * 0.001f; - std::cout << "[" << name << "]" << "Took: " << durationInuSeconds << " us (" << ms << " ms)" << std::endl; +// std::cout << "[" << name << "]" << "Took: " << durationInuSeconds << " us (" << ms << " ms)" << std::endl; } \ No newline at end of file diff --git a/BarinkEngine/src/Scene/Scene.cpp b/BarinkEngine/src/Scene/Scene.cpp index 66832c4..80d57c0 100644 --- a/BarinkEngine/src/Scene/Scene.cpp +++ b/BarinkEngine/src/Scene/Scene.cpp @@ -3,6 +3,7 @@ #include "Components.h" Scene::Scene() { + m_registry = entt::basic_registry(); } Scene::~Scene() diff --git a/Editor/premake5.lua b/Editor/premake5.lua index 3956da6..e058529 100644 --- a/Editor/premake5.lua +++ b/Editor/premake5.lua @@ -4,7 +4,8 @@ kind "ConsoleApp" buildmessage "Building editor ..." links{ - "BarinkEngine" + "BarinkEngine", + "ImGuizmo" } includedirs{ @@ -24,7 +25,9 @@ includedirs{ "./../libs/glew/include", "./../libs/glm", "./../libs/ImGui", + "./../libs/guizmo", + "./../libs/entt/src", "./include" @@ -37,4 +40,5 @@ libdirs { files { "./include/*.h", "./src/*.cpp" -} \ No newline at end of file +} + diff --git a/Editor/src/main.cpp b/Editor/src/main.cpp index 681775a..c652765 100644 --- a/Editor/src/main.cpp +++ b/Editor/src/main.cpp @@ -1,83 +1,79 @@ #include "../../BarinkEngine/src/BarinkEngine.h" -#include "../../BarinkEngine/src/Scene/SceneManager.h" -#include "../../BarinkEngine/src/Scene/SceneNodeTypes.h" #include "../../BarinkEngine/src/AssetManager/ModelImporter.h" -#include "../../BarinkEngine/src/Graphics/Framebuffer.h" +#include "../../BarinkEngine/src/Graphics/Memory/Framebuffer.h" #include - +#include "../../BarinkEngine/src/PerfCounter.cpp" +#include "../../BarinkEngine/src/Scene/Entity.h" +#include "stb_image.h" +#include "../../libs/guizmo/ImGuizmo.h" +#include "../../libs/glm/glm/gtc/type_ptr.hpp" +#include +#include "widgets/widgets.h" /* * Define globals */ -Shader* shader; -char* code = new char[254]; - -const std::string vertexShaderSource = "build/Debug/test.vs"; -const std::string fragmentShaderSource = "build/Debug/test.fs"; - -BarinkEngine::ModelImporter* MI = new BarinkEngine::ModelImporter(); Framebuffer* framebuffer; -Scene* Level1; -BarinkEngine::SceneObject* cube; +Scene Level1; +BarinkEngine::SceneObject* Model; +Entity cube; + /* * Runs once at startup * - USe to initialize the game/sandbox/demo */ void Start() { + + + auto io = ImGui::GetIO(); + io.Fonts->AddFontFromFileTTF("build/Debug/Fonts/Roboto-Regular.ttf", 18); + framebuffer = new Framebuffer(); // Build a basic test scene // NOTE: This will later be done through an editor // Create a level and load it as the current level - std::string levelName("Test Level"); - Level1 = SceneManager::CreateScene(levelName); - SceneManager::LoadScene(*Level1); + auto importer = BarinkEngine::ModelImporter(); + + // Create a cube + Model = importer.Import("build/Debug/Models/Cube.obj"); + cube = Level1.AddEntity("cube"); + auto& render3DComponent = cube.AddComponent(); + render3DComponent.mesh = *(Model->renderable->mesh); - shader = new Shader(vertexShaderSource, fragmentShaderSource); + cube.GetComponent().transform = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f, 0.0f, 5.0f)); + renderer.Prepare(Level1); + - // Create a cube node + // create an ambient light source + auto AmbientLight = Level1.AddEntity("AmbientLight"); + AmbientLight.AddComponent(); - cube = MI->Import("build/Debug/Models/cube.obj"); - cube->renderable->material = new Material(*shader); - cube->renderable->material->Color = glm::vec3(1.0f, 0.0f, 0.0f); + std::cout << "Colour attachment id; " << framebuffer->GetColourAttachment() << std::endl; - // What is in cube now ?? - std::cout << "mesh vertices: " << cube->renderable->mesh->vertices.size() << std::endl; - std::cout << "mesh elements: " << cube->renderable->mesh->elements.size() << std::endl; + renderer.Prepare(Level1); - Level1->GetRoot().addChild(*cube); - - memset(code, '\0', 254); - framebuffer = new Framebuffer(); - - std::cout << "Colour attachment id; " << framebuffer->GetColourAttachment() << std::endl; - // TODO: Move to runtime/ Engine - // NOTE: Submits should later be done through walking the sceneTree - - renderer.Submit(cube->renderable); } - /* * Runs every frame * - Use to draw Immediate mode graphics (Not meant for HUD's ) */ void ImmediateGraphicsDraw() -{ - - ImGui::DockSpaceOverViewport(ImGui::GetMainViewport()); +{ ImGui::DockSpaceOverViewport(ImGui::GetMainViewport()); // Show a menu bar ImGui::BeginMainMenuBar(); if (ImGui::BeginMenu("Application")) { + if (ImGui::MenuItem("Preferences")) { + + } if (ImGui::MenuItem("Exit")) { // TODO: Exit application } - - ImGui::EndMenu(); } @@ -85,45 +81,43 @@ void ImmediateGraphicsDraw() // Show internal BarinkEngine stats - ShowStats(); + //ShowStats(); + Viewport(*framebuffer , Level1); + Inspector(); + SceneExplorer(Level1); + Settings(); + AssetsFinder(); + Console(); - ImGui::Begin("Viewport"); - ImGui::Image((void*)(intptr_t)framebuffer->GetColourAttachment(), ImVec2{ 800,600 }); - ImGui::End(); - - static float Zoom = 90; - static glm::vec3 Position = glm::vec3(0.0f, 0.0f, 0.0f); - static glm::vec3 Rotation = glm::vec3(0.0f, 0.0f, 0.0f); - ImGui::Begin("Camera"); - ImGui::SliderFloat("Zoom", &Zoom, 10, 190); - ImGui::InputFloat3("Position:", &Position[0]); - ImGui::InputFloat3("Rotation:", &Rotation[0]); - ImGui::End(); - ImGui::Begin("Scripting"); - ImGui::Text("Lua Code"); - ImGui::InputTextMultiline("##", code, 255); - bool runCode = ImGui::Button("Run"); - ImGui::End(); - - ImGui::Begin("Scene Explorer"); - ImGui::End(); + ImGui::ShowMetricsWindow(); + } +void Render() +{ + renderer.Render( *framebuffer, Level1); +} + + /* * Runs every frame * - Meant for game logic ( non-physics related) */ void Update() { - // glBindFramebuffer(GL_FRAMEBUFFER, framebuffer->GetId()); - renderer.Render(*framebuffer); +} - // glBindFramebuffer(GL_FRAMEBUFFER, 0); +/* +* Runs every physics update +*/ +void fixed_update() +{ + } /* @@ -133,6 +127,4 @@ void Update() void Stop() { delete framebuffer; - delete MI; - delete shader; } \ No newline at end of file diff --git a/Editor/src/widgets/widgets.h b/Editor/src/widgets/widgets.h new file mode 100644 index 0000000..2156948 --- /dev/null +++ b/Editor/src/widgets/widgets.h @@ -0,0 +1,79 @@ +#pragma once +#include +#include + +inline void Inspector () { + ImGui::Begin("Inspector"); + static float Zoom = 90; + static glm::vec3 Position = glm::vec3(0.0f, 0.0f, 0.0f); + static glm::vec3 Rotation = glm::vec3(0.0f, 0.0f, 0.0f); + + ImGui::BeginChild("Camera"); + + ImGui::SliderFloat("Zoom", &Zoom, 10, 190); + ImGui::InputFloat3("Position:", &Position[0]); + + ImGui::InputFloat3("Rotation:", &Rotation[0]); + ImGui::EndChild(); + + + ImGui::BeginChild("Scripting"); + ImGui::Text("Hello world!"); + ImGui::EndChild(); + ImGui::End(); +} + +inline void SceneExplorer(Scene& scene) +{ + + ImGui::Begin("Scene Explorer"); + + scene.getReg().each([&](auto entity) { + auto id = scene.getReg().get(entity); + ImGui::LabelText("##myObject", "%s", id.name.c_str()); + }); + + + ImGui::End(); +} + +inline void Viewport(Framebuffer& framebuffer , Scene& scene ) { + + unsigned int viewportWindowFlags = ImGuiWindowFlags_NoTitleBar + | ImGuiWindowFlags_NoDecoration + | ImGuiWindowFlags_NoScrollbar + | ImGuiWindowFlags_NoMove + | ImGuiWindowFlags_NoCollapse; + + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2{ 0,0 }); + ImGui::Begin("Viewport", false, viewportWindowFlags ); + ImGui::Image((void*)(intptr_t)framebuffer.GetColourAttachment(), ImVec2{ (float)800,(float)600 }); + + ImGuizmo::SetDrawlist(); + ImGuizmo::SetRect(ImGui::GetWindowPos().x, ImGui::GetWindowPos().y, ImGui::GetWindowWidth(), ImGui::GetWindowHeight()); + ImGuizmo::Enable(true); + auto cam = glm::mat4(1.0f); + //ImGuizmo::Manipulate(glm::value_ptr(static_cam), glm::value_ptr(static_projection), ImGuizmo::TRANSLATE, ImGuizmo::WORLD, glm::value_ptr(trans)); + ImGuizmo::ViewManipulate(glm::value_ptr(cam), 8.0f, ImVec2{ 0.0f,0.0f }, ImVec2{ 128.0f,128.0f }, 0x10101010); + ImGui::End(); + ImGui::PopStyleVar(); + +} + +inline void Settings() { + ImGui::Begin("Settings"); + ImGui::LabelText("##title-settings", "Fine grain control over your engine... "); + ImGui::End(); +} + +inline void Console() { + ImGui::Begin("Console", false ); + ImGui::Dummy(ImVec2{ 128, 128 }); + ImGui::End(); +} + +inline void AssetsFinder() { + ImGui::Begin("Asset-Finder", false ); + ImGui::Dummy(ImVec2{ 128, 128 }); + ImGui::End(); +} \ No newline at end of file