Begin Repo
This commit is contained in:
47
src/application.cpp
Normal file
47
src/application.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user