50 lines
900 B
C++
50 lines
900 B
C++
//
|
|
// Created by sebastian on 23.12.25.
|
|
//
|
|
|
|
#include "Application.h"
|
|
|
|
#include "../layer/Layer.h"
|
|
#include "../platform/glfw/InputManager.h"
|
|
|
|
Application* Application::instance = nullptr;
|
|
|
|
void Application::pushLayer(Layer* layer) {
|
|
layers.push_back(layer);
|
|
layer->onAttach();
|
|
}
|
|
|
|
Application::Application()
|
|
{
|
|
instance = this;
|
|
|
|
WindowProps window_props = WindowProps();
|
|
window_props.Width = 1280;
|
|
window_props.Height = 720;
|
|
window_props.Title = "DiceSettlers v0.0.1";
|
|
window_props.VSync = true;
|
|
|
|
window.reset(Window::Create(window_props));
|
|
}
|
|
|
|
Application::~Application()
|
|
{
|
|
}
|
|
|
|
void Application::run() {
|
|
while (!window->shouldClose())
|
|
{
|
|
for (Layer* layer : layers)
|
|
{
|
|
layer->onUpdate();
|
|
}
|
|
window->OnUpdate();
|
|
InputManager::update();
|
|
}
|
|
}
|
|
|
|
Application& Application::getInstance()
|
|
{
|
|
return *instance;
|
|
}
|