YoggieEngine/Editor/src/app.cpp
Nigel Barink 3c38e2a988 Editor Layer + Updating Camera System
Started updating the camera system, Moving editor logic to an Editor layer
2023-05-08 22:07:29 +02:00

60 lines
1014 B
C++

#include "../../YoggieEngine/src/EntryPoint.h"
#include <stack>
#include "EditorLayer.h"
using namespace YoggieEngine;
class Editor : public Application {
public:
Editor() : Application("Editor"){}
void Run() override
{
// Create EditorLayer
EditorLayer* firstLayer = new EditorLayer();
firstLayer->OnStartup();
double previous = glfwGetTime();
double lag = 0.0;
while (!appWindow->WindowShouldClose()) {
PollEvents();
double now = glfwGetTime();
double elapsed = now - previous;
previous = now;
lag += elapsed;
GuiBegin();
firstLayer->OnUpdate();
firstLayer->OnUI();
GuiEnd();
SwapBuffers();
}
firstLayer->OnDestroy();
}
private:
std::vector<Layer*> layers = std::vector<Layer*>();
};
YoggieEngine::Application* CreateApplication() {
return new Editor();
}