Runtime now working

This commit is contained in:
Antoine Pilote
2023-08-08 14:24:17 -04:00
parent 88bf953102
commit 35940b3356
9 changed files with 188 additions and 72 deletions

View File

@@ -1,46 +0,0 @@
#include <Engine.h>
#include <src/Rendering/SceneRenderer.h>
#include <dependencies/GLEW/include/GL/glew.h>
#include <dependencies/glfw/include/GLFW/glfw3.h>
#include <iostream>
#include <string>
void CheckError()
{
GLenum err;
while ((err = glGetError()) != GL_NO_ERROR)
{
// Process/log the error.
std::cout << "OPENGL ERROR: " << err << std::endl;
}
}
void main(int argc, char* argv[])
{
using namespace Nuake;
Engine::Init();
auto window = Nuake::Engine::GetCurrentWindow();
window->SetTitle("asdasd");
Ref<Scene> scene = Scene::New();
Engine::LoadScene(scene);
while (!window->ShouldClose())
{
Nuake::Engine::Tick();
const auto& WindowSize = window->GetSize();
glViewport(0, 0, WindowSize.x, WindowSize.y);
RenderCommand::SetClearColor({ 0.1, 0.1 ,0.1, 1.0 });
RenderCommand::Clear();
Engine::Draw();
Renderer::DrawLine(Vector3(0, 0, 0), Vector3(10, 10, 0), Color(1, 0, 0, 1));
Engine::EndDraw();
}
}