YoggieEngine/Editor/src/app.cpp

60 lines
1014 B
C++
Raw Normal View History

2022-11-12 15:57:34 +00:00
#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*>();
};
2022-11-12 15:57:34 +00:00
YoggieEngine::Application* CreateApplication() {
return new Editor();
}