60 lines
1014 B
C++
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();
|
|
|
|
}
|
|
|
|
|