48 lines
704 B
C++
Executable File
48 lines
704 B
C++
Executable File
#include "application.h"
|
|
|
|
App* App::instance = nullptr;
|
|
|
|
App::App() {
|
|
|
|
if(instance != nullptr) {
|
|
std::cout << "App already exists\nThere can only be one!\n";
|
|
std::abort();
|
|
}
|
|
|
|
std::cout << "Initializing...\n";
|
|
|
|
instance = this;
|
|
|
|
window.init("test", 640, 640);
|
|
|
|
renderer.init();
|
|
|
|
}
|
|
|
|
App::~App() {
|
|
|
|
lStack.shutdown();
|
|
|
|
renderer.shutdown();
|
|
|
|
window.shutdown();
|
|
|
|
std::cout << "\nExiting...";
|
|
}
|
|
|
|
void App::run() {
|
|
std::cout << "\nTesting...\n";
|
|
|
|
lStack.pushLayer(new BaseLayer());
|
|
lStack.pushOverlay(new Overlay());
|
|
|
|
// Main loop
|
|
while (!done) {
|
|
|
|
lStack.propagateEvent(window.pollEvents());
|
|
|
|
renderer.draw();
|
|
}
|
|
}
|
|
|