This commit is contained in:
Antoine Pilote
2023-07-22 20:14:06 -04:00
parent aed3bb688a
commit a5227cfb12

View File

@@ -1,14 +1,12 @@
#include <Engine.h>
#include <src/Rendering/SceneRenderer.h>
#include <dependencies/GLEW/include/GL/glew.h>
#include <dependencies/glfw/include/GLFW/glfw3.h>
#include <string>
#include <Engine.h>
#include <src/Core/Logger.h>
#include <src/Rendering/SceneRenderer.h>
#include <iostream>
#include <src/Vendors/imgui/imgui.h>
#include <string>
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<Nuake::Window> 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 = 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();
}
}