diff --git a/Editor/src/EditorContext.h b/Editor/src/EditorContext.h new file mode 100644 index 0000000..a3df695 --- /dev/null +++ b/Editor/src/EditorContext.h @@ -0,0 +1,9 @@ +#pragma once +struct EditorContext { + std::shared_ptr CurrentProject; + Scene MainScene; + + EditorContext() = default; + EditorContext(EditorContext& other) = default; + ~EditorContext() = default; +}; diff --git a/Editor/src/SceneRuntime.h b/Editor/src/SceneRuntime.h new file mode 100644 index 0000000..0164cde --- /dev/null +++ b/Editor/src/SceneRuntime.h @@ -0,0 +1,70 @@ +#pragma once +#include "../../YoggieEngine/src/BarinkEngine.h" +#include "../../YoggieEngine/src/AssetManager/ModelImporter.h" +#include "../../YoggieEngine/src/Graphics/Memory/Framebuffer.h" +#include "../../YoggieEngine/src/PerfCounter.cpp" +#include "../../YoggieEngine/src/Scene/Entity.h" +#include "Project.h" + +class SceneRuntime : public ApplicationRuntime { + +public: + SceneRuntime() = default; + void Start() override + { + CurrentProject = std::make_shared("Random"); + + framebuffer = new Framebuffer(); + + // Create a level and load it as the current level + auto importer = ModelImporter(); + + // Create a cube + Model = importer.Import("build/Debug/Models/Cube.obj"); + cube = MainScene.AddEntity("cube"); + + auto& render3DComponent = cube.AddComponent(); + render3DComponent.mesh = *(Model->renderable->mesh); + + cube.GetComponent().Position = glm::vec3(1.0f, 0.0f, 5.0f); + + auto cube2 = MainScene.AddEntity("Cube1"); + auto& rendercube2 = cube2.AddComponent(); + rendercube2.mesh = *(Model->renderable->mesh); + + + // create an ambient light source + auto AmbientLight = MainScene.AddEntity("AmbientLight"); + auto light = AmbientLight.AddComponent(); + light.Color = glm::vec3(1.0f); + light.Strength = 1.0f; + + Selected = (entt::entity)-1; + + } + + void Update() override + { + } + + void FixedUpdate() override + { + } + + void Stop() override + { + } + + +private: + std::shared_ptr CurrentProject = nullptr; + Scene MainScene; + + Framebuffer* framebuffer; + SceneObject* Model; + Entity cube; + + + entt::entity Selected; + friend class Editor; +}; \ No newline at end of file diff --git a/Editor/src/UI/widgets.cpp b/Editor/src/UI/widgets.cpp index 12ce3bb..2d4573f 100644 --- a/Editor/src/UI/widgets.cpp +++ b/Editor/src/UI/widgets.cpp @@ -108,7 +108,7 @@ void SceneExplorer(entt::entity& selected, Scene& scene ) ImGui::End(); } -void Viewport(Framebuffer& framebuffer, Scene& scene) { +void Viewport(Framebuffer& framebuffer) { unsigned int viewportWindowFlags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoDecoration diff --git a/Editor/src/UI/widgets.h b/Editor/src/UI/widgets.h index ec59cf6..1caaf3d 100644 --- a/Editor/src/UI/widgets.h +++ b/Editor/src/UI/widgets.h @@ -17,7 +17,7 @@ void Inspector(entt::entity entity, Scene& scene); void SceneExplorer(entt::entity& selected, Scene& scene); -void Viewport(Framebuffer& framebuffer, Scene& scene); +void Viewport(Framebuffer& framebuffer); void Settings(); diff --git a/Editor/src/app.cpp b/Editor/src/app.cpp new file mode 100644 index 0000000..de9f7b0 --- /dev/null +++ b/Editor/src/app.cpp @@ -0,0 +1,270 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "../../libs/guizmo/ImGuizmo.h" + +#include "UI/Widgets.h" +#include "Project.h" +#include "SceneSerializer.h" +#include "EditorContext.h" +#include "SceneRuntime.h" +#include "../../YoggieEngine/src/BarinkEngine.h" + +const unsigned int MS_PER_UPDATE = 2; + + +class Editor : public Application { +public: + Editor() : Application("Editor") {} + void Run() override + { + BarinkWindow mainWindow = BarinkWindow(1200, 700); + + InputSystem = new InputManager(); + renderer = new Renderer(); + + InputSystem->attach(&mainWindow); + + InitImGui(mainWindow); + + activeRuntime.Start(); + + double previous = glfwGetTime(); + double lag = 0.0; + + renderer->Prepare(activeRuntime.MainScene); + + while (!mainWindow.WindowShouldClose()) + { + + double current = glfwGetTime(); + double elapsed = current - previous; + previous = current; + lag += elapsed; + + InputSystem->PollEvents(); + + while (lag >= MS_PER_UPDATE) + { + activeRuntime.Update(); + lag -= MS_PER_UPDATE; + } + + renderer->Render(activeRuntime.framebuffer, activeRuntime.MainScene); + + ImGuiBegin(); + RenderGUI(); + ImGuiEnd(); + + mainWindow.SwapBuffers(); + glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT); + + + } + + activeRuntime.Stop(); + + delete InputSystem; + delete renderer; + + ImGui_ImplOpenGL3_Shutdown(); + ImGui_ImplGlfw_Shutdown(); + ImGui::DestroyContext(); + + } + + void InitImGui(BarinkWindow& window ) + { + IMGUI_CHECKVERSION(); + ImGui::CreateContext(); + ImGuiIO& io = ImGui::GetIO(); + io.ConfigFlags |= ImGuiConfigFlags_::ImGuiConfigFlags_ViewportsEnable; + io.ConfigFlags |= ImGuiConfigFlags_::ImGuiConfigFlags_DockingEnable; + io.Fonts->AddFontFromFileTTF("build/Debug/Fonts/Roboto-Regular.ttf", 18); + + + ImGui::StyleColorsDark(); + + ImGui_ImplGlfw_InitForOpenGL(window.windowptr(), true); + ImGui_ImplOpenGL3_Init("#version 440"); + + + } + + void ImGuiBegin() { + ImGui_ImplGlfw_NewFrame(); + ImGui_ImplOpenGL3_NewFrame(); + + ImGui::NewFrame(); + + ImGuizmo::SetOrthographic(true); + ImGuizmo::BeginFrame(); + + } + + void ImGuiEnd() { + ImGui::EndFrame(); + + + ImGui::Render(); + ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); + + if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable) + { + GLFWwindow* last_context = glfwGetCurrentContext(); + ImGui::UpdatePlatformWindows(); + ImGui::RenderPlatformWindowsDefault(); + glfwMakeContextCurrent(last_context); + } + } + + + void RenderGUI() { + ImGui::DockSpaceOverViewport(ImGui::GetMainViewport()); + + // Show a menu bar + + ImGui::BeginMainMenuBar(); + + if (ImGui::BeginMenu("Application")) { + + if (ImGui::MenuItem("Load Project")) + { + nfdresult_t result = NFD_OpenDialog({ "yproj" }, NULL, &path); + switch (result) { + case(NFD_OKAY): + Project::LoadProject(path, activeRuntime.CurrentProject); + break; + case(NFD_CANCEL): + break; + case(NFD_ERROR): + std::cout << "NFD_Error: " << NFD_GetError() << std::endl; + break; + } + + } + + if (ImGui::MenuItem("Save project as...")) { + nfdresult_t result = NFD_SaveDialog({ "yproj" }, NULL, &savePath); + switch (result) { + case(NFD_OKAY): + std::cout << "Save as: " << savePath << std::endl; + Project::SaveProject(savePath, *activeRuntime.CurrentProject.get()); + break; + case(NFD_CANCEL): + break; + case(NFD_ERROR): + std::cout << "NFD_Error: " << NFD_GetError() << std::endl; + break; + } + } + + + + if (ImGui::MenuItem("Preferences")) + { + + } + + if (ImGui::MenuItem("Exit")) + { + // TODO: Exit application + } + + ImGui::EndMenu(); + } + + + if (ImGui::BeginMenu("Scene")) { + + if (ImGui::MenuItem("Save scene")) + { + nfdresult_t result = NFD_SaveDialog({ "yscene" }, NULL, &scenePath); + switch (result) { + case(NFD_OKAY): + SaveScene(scenePath, activeRuntime.MainScene); + break; + case(NFD_CANCEL): + break; + case(NFD_ERROR): + std::cout << "NFD_Error: " << NFD_GetError() << std::endl; + break; + } + + } + + if (ImGui::MenuItem("Load scene")) + { + auto result = NFD_OpenDialog({ "yscene" }, NULL, &openScenePath); + switch (result) { + case (NFD_OKAY): + LoadScene(openScenePath, activeRuntime.MainScene); + break; + case(NFD_CANCEL): + break; + case(NFD_ERROR): + std::cout << "NFD_Error: " << NFD_GetError() << std::endl; + break; + } + + } + + if (ImGui::MenuItem("Add Entity")) { + activeRuntime.MainScene.AddEntity("New Entity"); + } + + ImGui::EndMenu(); + } + + + ImGui::EndMainMenuBar(); + + ImGui::Begin("ProjectInfo"); + ImGui::Text("Project: %s", activeRuntime.CurrentProject.get()->GetName().c_str()); + ImGui::Text("Directory: %s", activeRuntime.CurrentProject.get()->GetProjectDirectory().u8string().c_str()); + ImGui::End(); + + + //ShowStats(); + Viewport(*activeRuntime.framebuffer); + SceneExplorer(activeRuntime.Selected, activeRuntime.MainScene); + Inspector(activeRuntime.Selected, activeRuntime.MainScene); + + Settings(); + AssetsFinder(); + Console(); + + ImGui::ShowDemoWindow(); + ImGui::ShowMetricsWindow(); + + } + + +private: + EditorContext context; + SceneRuntime activeRuntime ; + char* path = nullptr; + char* savePath = nullptr; + char* scenePath = nullptr; + char* openScenePath = nullptr; + + +}; + +int main (int argc , char* argv[]) { + + Editor().Run(); + +} + + + + + + + diff --git a/Editor/src/main.cpp b/Editor/src/main.cpp deleted file mode 100644 index b1689b6..0000000 --- a/Editor/src/main.cpp +++ /dev/null @@ -1,242 +0,0 @@ -#include -#include -#include -#include -#include - -#include "../../libs/guizmo/ImGuizmo.h" -#include "../../YoggieEngine/src/BarinkEngine.h" -#include "../../YoggieEngine/src/AssetManager/ModelImporter.h" -#include "../../YoggieEngine/src/Graphics/Memory/Framebuffer.h" -#include "../../YoggieEngine/src/PerfCounter.cpp" -#include "../../YoggieEngine/src/Scene/Entity.h" -#include "UI/Widgets.h" -#include "Project.h" -#include "SceneSerializer.h" - - - -using namespace YoggieEngine; -/* -* Define globals -*/ - -struct EditorContext { - Project CurrentProject; - Scene MainScene; - - EditorContext() = default; - EditorContext(EditorContext& other) = default; - ~EditorContext() = default; -}; - -std::shared_ptr CurrentProject; -Scene MainScene; - -Framebuffer* framebuffer; -SceneObject* Model; -Entity cube; - - -entt::entity Selected; - -/* -* Runs once at startup -* - USe to initialize the game/sandbox/demo -*/ -void Start() { - - CurrentProject = std::make_shared("Random"); - auto io = ImGui::GetIO(); - io.Fonts->AddFontFromFileTTF("build/Debug/Fonts/Roboto-Regular.ttf", 18); - - framebuffer = new Framebuffer(); - - - // Create a level and load it as the current level - auto importer = ModelImporter(); - - // Create a cube - Model = importer.Import("build/Debug/Models/Cube.obj"); - cube = MainScene.AddEntity("cube"); - - auto& render3DComponent = cube.AddComponent(); - render3DComponent.mesh = *(Model->renderable->mesh); - - cube.GetComponent().Position = glm::vec3(1.0f, 0.0f, 5.0f); - - auto cube2 = MainScene.AddEntity("Cube1"); - auto& rendercube2 = cube2.AddComponent(); - rendercube2.mesh = *(Model->renderable->mesh); - - - // create an ambient light source - auto AmbientLight = MainScene.AddEntity("AmbientLight"); - auto light = AmbientLight.AddComponent(); - light.Color = glm::vec3(1.0f); - light.Strength = 1.0f; - - Selected = (entt::entity) -1; - - renderer.Prepare(MainScene); -} - - -char* path = nullptr; -char* savePath = nullptr; -char* scenePath = nullptr; -char* openScenePath = nullptr; -/* -* Runs every frame -* - Use to draw Immediate mode graphics (Not meant for HUD's ) -*/ -void ImmediateGraphicsDraw() -{ ImGui::DockSpaceOverViewport(ImGui::GetMainViewport()); - - // Show a menu bar - - ImGui::BeginMainMenuBar(); - - if (ImGui::BeginMenu("Application")) { - - if (ImGui::MenuItem("Load Project")) - { - nfdresult_t result = NFD_OpenDialog({ "yproj" }, NULL, &path); - switch (result) { - case(NFD_OKAY): - Project::LoadProject( path, CurrentProject); - break; - case(NFD_CANCEL): - break; - case(NFD_ERROR): - std::cout << "NFD_Error: " << NFD_GetError() << std::endl; - break; - } - - } - - if (ImGui::MenuItem("Save project as...")) { - nfdresult_t result = NFD_SaveDialog({ "yproj" }, NULL, &savePath); - switch (result) { - case(NFD_OKAY): - std::cout << "Save as: " << savePath << std::endl; - Project::SaveProject(savePath, *CurrentProject.get()); - break; - case(NFD_CANCEL): - break; - case(NFD_ERROR): - std::cout << "NFD_Error: " << NFD_GetError() << std::endl; - break; - } - } - - - - if (ImGui::MenuItem("Preferences")) - { - - } - - if (ImGui::MenuItem("Exit")) - { - // TODO: Exit application - } - - ImGui::EndMenu(); - } - - - if (ImGui::BeginMenu("Scene")) { - - if (ImGui::MenuItem("Save scene")) - { - nfdresult_t result= NFD_SaveDialog({"yscene"},NULL, &scenePath); - switch (result) { - case(NFD_OKAY): - SaveScene(scenePath, MainScene); - break; - case(NFD_CANCEL): - break; - case(NFD_ERROR): - std::cout << "NFD_Error: " << NFD_GetError() << std::endl; - break; - } - - } - - if (ImGui::MenuItem("Load scene")) - { - auto result = NFD_OpenDialog({ "yscene" }, NULL, &openScenePath); - switch (result) { - case (NFD_OKAY): - LoadScene(openScenePath, MainScene); - break; - case(NFD_CANCEL): - break; - case(NFD_ERROR): - std::cout << "NFD_Error: " << NFD_GetError() << std::endl; - break; - } - - } - - if (ImGui::MenuItem("Add Entity")) { - MainScene.AddEntity("New entity"); - } - - ImGui::EndMenu(); - } - - - ImGui::EndMainMenuBar(); - - ImGui::Begin("ProjectInfo"); - ImGui::Text("Project: %s", CurrentProject.get()->GetName().c_str()); - ImGui::Text("Directory: %s", CurrentProject.get()->GetProjectDirectory().u8string().c_str()); - ImGui::End(); - - - //ShowStats(); - Viewport(*framebuffer, MainScene); - SceneExplorer(Selected, MainScene); - Inspector(Selected, MainScene ); - - Settings(); - AssetsFinder(); - Console(); - - ImGui::ShowDemoWindow(); - ImGui::ShowMetricsWindow(); - - -} - -void Render() -{ - renderer.Render( *framebuffer, MainScene); -} - -/* -* Runs every frame -* - Meant for game logic ( non-physics related) -*/ -void Update() -{ -} - -/* -* Runs every physics update -*/ -void fixed_update() -{ - -} - -/* -* Runs at the end of the program -* - Meant for cleanup -*/ -void Stop() -{ - delete framebuffer; -} \ No newline at end of file diff --git a/YoggieEngine/src/Application.cpp b/YoggieEngine/src/Application.cpp new file mode 100644 index 0000000..c313186 --- /dev/null +++ b/YoggieEngine/src/Application.cpp @@ -0,0 +1,18 @@ +#include "Application.h" + + + +namespace YoggieEngine { + Application::Application(const std::string& name ) + : m_AppName(name) + { + EngineInstrumentation::PerfomanceSamplerInit(); + } + + + void Application::Run() { + std::cout << "No run function implemented!"; + } + + +} \ No newline at end of file diff --git a/YoggieEngine/src/Application.h b/YoggieEngine/src/Application.h new file mode 100644 index 0000000..5061aaf --- /dev/null +++ b/YoggieEngine/src/Application.h @@ -0,0 +1,36 @@ +#pragma once +#include "Input/InputManager.h" +#include "Graphics/Renderer.h" +#include +#include +#include +namespace YoggieEngine { + // forward declaration + class InputManager; + + class Application { + public: + Application(const std::string& name); + virtual void Run(); + + + protected: + std::string m_AppName; + Renderer* renderer = nullptr; + InputManager* InputSystem = nullptr; + friend class ApplicationRuntime; + }; + + + class ApplicationRuntime { + + public: + virtual void Start() = 0; + virtual void Update() = 0; + virtual void FixedUpdate() = 0; + virtual void Stop() = 0; + + }; + + +}; diff --git a/YoggieEngine/src/BarinkEngine.cpp b/YoggieEngine/src/BarinkEngine.cpp index b3116a7..cbbb4b3 100644 --- a/YoggieEngine/src/BarinkEngine.cpp +++ b/YoggieEngine/src/BarinkEngine.cpp @@ -1,84 +1 @@ #include "BarinkEngine.h" -using namespace YoggieEngine; - -Renderer renderer; - -const unsigned int MS_PER_UPDATE = 2; - -int main(int argc, char* argv[]) { - // Setup performance sampler - EngineInstrumentation::PerfomanceSamplerInit(); - - // Startup services - BarinkWindow MainWindow = BarinkWindow(1200, 700); - - renderer = Renderer(); - InputSystem = InputManager(); - - InputSystem.attach(&MainWindow); - - GUIManager GUISystem = GUIManager(&MainWindow); - - glEnable(GL_DEPTH_TEST); - - // First call to setup game - { - Start(); - } - - - double previous = glfwGetTime(); - double lag = 0.0; - - // Runtime loop - while (!MainWindow.WindowShouldClose()) - { - - double current = glfwGetTime(); - double elapsed = current - previous; - previous = current; - lag += elapsed; - - //EngineInstrumentation::Update(); // Todo this does nothing right now and is therefor disabled - - // Execute main logic - { - InputSystem.PollEvents(); - - } - - { - while (lag >= MS_PER_UPDATE) { - Update(); - lag -= MS_PER_UPDATE; - } - } - - { - Render(); - } - - { - GUISystem.Render(); - } - - - { - MainWindow.SwapBuffers(); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - } - - } - - // Shutdown game - { - Stop(); - } - - // Shutdown Services - - return 0; -} - - - diff --git a/YoggieEngine/src/BarinkEngine.h b/YoggieEngine/src/BarinkEngine.h index 929c82e..a7e65fd 100644 --- a/YoggieEngine/src/BarinkEngine.h +++ b/YoggieEngine/src/BarinkEngine.h @@ -1,21 +1,23 @@ #pragma once -#include "glm/glm.hpp" -#include "graphics/Primitives/Shader.h" -#include "Platform/Window.h" -#include "graphics/Primitives/Texture.h" -#include "graphics/Primitives/Camera.h" -#include "graphics/Renderable.h" -#include "Graphics/Renderer.h" -#include "Graphics/Primitives/Material.h" -#include "Input/InputManager.h" -#include "Graphics/Renderer.h" -#include "GUI/GUIManager.h" -#include "Scene/Scene.h" -using namespace YoggieEngine; -extern Renderer renderer; +#include -extern void Start(); -extern void Update(); -extern void Render(); -extern void ImmediateGraphicsDraw(); -extern void Stop(); + +#include "glm/glm.hpp" + +#include "Platform/Window.h" + +#include "Graphics/Primitives/Shader.h" +#include "Graphics/Primitives/Texture.h" +#include "Graphics/Primitives/Camera.h" +#include "Graphics/Primitives/Material.h" +#include "Graphics/Renderer.h" + +#include "spdlog/spdlog.h" + +#include "EventSystem/EventEmitter.h" +#include "EventSystem/EventListener.h" + +#include "Input/InputManager.h" + +#include "Scene/Scene.h" +#include "Application.h" diff --git a/YoggieEngine/src/GUI/GUIManager.cpp b/YoggieEngine/src/GUI/GUIManager.cpp deleted file mode 100644 index 444436b..0000000 --- a/YoggieEngine/src/GUI/GUIManager.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "GUIManager.h" -#include "imgui.h" -#include "backends/imgui_impl_opengl3.h" -#include -#include "../../libs/guizmo/ImGuizmo.h" -#include "../BarinkEngine.h" - -namespace YoggieEngine { - - GUIManager::GUIManager(BarinkWindow* window) - : currentwindow(window) - { - IMGUI_CHECKVERSION(); - ImGui::CreateContext(); - ImGuiIO& io = ImGui::GetIO(); - io.ConfigFlags |= ImGuiConfigFlags_::ImGuiConfigFlags_ViewportsEnable; - io.ConfigFlags |= ImGuiConfigFlags_::ImGuiConfigFlags_DockingEnable; - - ImGui::StyleColorsDark(); - - ImGui_ImplGlfw_InitForOpenGL(currentwindow->windowptr(), true); - ImGui_ImplOpenGL3_Init("#version 440"); - - - } - - GUIManager::~GUIManager() - { - ImGui_ImplOpenGL3_Shutdown(); - ImGui_ImplGlfw_Shutdown(); - ImGui::DestroyContext(); - } - - void GUIManager::Render() - { - ImGui_ImplGlfw_NewFrame(); - ImGui_ImplOpenGL3_NewFrame(); - - ImGui::NewFrame(); - - ImGuizmo::SetOrthographic(true); - ImGuizmo::BeginFrame(); - - - - ImmediateGraphicsDraw(); - - - - ImGui::EndFrame(); - - - ImGui::Render(); - ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); - - if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable) - { - GLFWwindow* last_context = glfwGetCurrentContext(); - ImGui::UpdatePlatformWindows(); - ImGui::RenderPlatformWindowsDefault(); - glfwMakeContextCurrent(last_context); - } - } - -} diff --git a/YoggieEngine/src/GUI/GUIManager.h b/YoggieEngine/src/GUI/GUIManager.h deleted file mode 100644 index ace922b..0000000 --- a/YoggieEngine/src/GUI/GUIManager.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once -#include "../Platform/Window.h" - -namespace YoggieEngine { - class GUIManager { - public: - GUIManager(BarinkWindow* window); - ~GUIManager(); - void Render(); - - private: - BarinkWindow* currentwindow; - }; -} diff --git a/YoggieEngine/src/Graphics/Renderer.cpp b/YoggieEngine/src/Graphics/Renderer.cpp index 1edc392..e686a9a 100644 --- a/YoggieEngine/src/Graphics/Renderer.cpp +++ b/YoggieEngine/src/Graphics/Renderer.cpp @@ -10,7 +10,10 @@ float Angle = 0.0; Camera cam = Camera(glm::vec3(12.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), 90.0f); glm::mat4 projection = glm::perspective(glm::radians(cam.Zoom), (800.0f / 600.0f), 0.001f, 100.0f); -Renderer::Renderer(){} +Renderer::Renderer(){ + glEnable(GL_DEPTH_TEST); + +} Renderer::~Renderer(){} @@ -88,10 +91,12 @@ void Renderer::Render(Scene& scene) } -void Renderer::Render(Framebuffer& framebuffer, Scene& scene) +void Renderer::Render(Framebuffer* framebuffer, Scene& scene) { + if (framebuffer == nullptr) + return; - glBindFramebuffer(GL_FRAMEBUFFER, framebuffer.GetId()); + glBindFramebuffer(GL_FRAMEBUFFER, framebuffer->GetId()); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); diff --git a/YoggieEngine/src/Graphics/Renderer.h b/YoggieEngine/src/Graphics/Renderer.h index 024073f..dfed554 100644 --- a/YoggieEngine/src/Graphics/Renderer.h +++ b/YoggieEngine/src/Graphics/Renderer.h @@ -22,6 +22,6 @@ namespace YoggieEngine { void Prepare(Scene& scene); void Render(Scene& scene ); - void Render(Framebuffer& framebuffer, Scene& scene); + void Render(Framebuffer* framebuffer, Scene& scene); }; } diff --git a/YoggieEngine/src/Input/InputManager.h b/YoggieEngine/src/Input/InputManager.h index 2c1e0c0..38939af 100644 --- a/YoggieEngine/src/Input/InputManager.h +++ b/YoggieEngine/src/Input/InputManager.h @@ -1,11 +1,6 @@ #pragma once -#include -#include +#include "../BarinkEngine.h" -#include "spdlog/spdlog.h" -#include "../EventSystem/EventEmitter.h" -#include "../EventSystem/EventListener.h" -#include "../Platform/Window.h" namespace YoggieEngine {