From a5227cfb12f80378d8e3870a09131f59e3997a2c Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Sat, 22 Jul 2023 20:14:06 -0400 Subject: [PATCH] r --- Editor/Runtime.cpp | 51 +++++++++++----------------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/Editor/Runtime.cpp b/Editor/Runtime.cpp index ce641fdc..636c7c45 100644 --- a/Editor/Runtime.cpp +++ b/Editor/Runtime.cpp @@ -1,14 +1,12 @@ + +#include +#include + #include #include - -#include -#include -#include -#include - #include -#include +#include void CheckError() { @@ -22,52 +20,27 @@ void CheckError() void main(int argc, char* argv[]) { - std::string projectPath; - if (argc == 1) - { - return; - } - - projectPath = std::string(argv[1]); - using namespace Nuake; - Nuake::Engine::Init(); + Engine::Init(); - Ref window = Nuake::Engine::GetCurrentWindow(); + auto window = Nuake::Engine::GetCurrentWindow(); window->SetTitle("asdasd"); - FileSystem::SetRootDirectory(FileSystem::GetParentPath(projectPath)); - auto project = Project::New(); - auto scene = Scene::New(); - auto projectFileData = FileSystem::ReadFile(projectPath, true); - try - { - project->Deserialize(projectFileData); - project->FullPath = projectPath; - Engine::LoadProject(project); - } - catch (std::exception exception) - { - Logger::Log("Error loading project: " + projectPath, "editor", CRITICAL); - Logger::Log(exception.what()); - } - - //Engine::EnterPlayMode(); + Ref scene = Scene::New(); + Engine::LoadScene(scene); while (!window->ShouldClose()) { Nuake::Engine::Tick(); - Nuake::Engine::Draw(); - ImGui::Begin("test"); - - ImGui::End(); const auto& WindowSize = window->GetSize(); glViewport(0, 0, WindowSize.x, WindowSize.y); RenderCommand::SetClearColor({ 0.1, 0.1 ,0.1, 1.0 }); RenderCommand::Clear(); - Nuake::Engine::EndDraw(); + Engine::Draw(); + Renderer::DrawLine(Vector3(0, 0, 0), Vector3(10, 10, 0), Color(1, 0, 0, 1)); + Engine::EndDraw(); } } \ No newline at end of file