aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Engine.cpp')
-rw-r--r--src/crepe/api/Engine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crepe/api/Engine.cpp b/src/crepe/api/Engine.cpp
index 7ae89b9..e8b7fd6 100644
--- a/src/crepe/api/Engine.cpp
+++ b/src/crepe/api/Engine.cpp
@@ -5,12 +5,12 @@
using namespace crepe;
using namespace std;
-void Engine::start() {
+int Engine::main() noexcept {
try {
this->setup();
} catch (const exception & e) {
Log::logf(Log::Level::ERROR, "Uncaught exception in setup: {}\n", e.what());
- return;
+ return EXIT_FAILURE;
}
try {
@@ -19,10 +19,11 @@ void Engine::start() {
Log::logf(Log::Level::ERROR, "Uncaught exception in main loop: {}\n", e.what());
this->event_manager.trigger_event<ShutDownEvent>();
}
+
+ return EXIT_SUCCESS;
}
void Engine::setup() {
- this->game_running = true;
this->loop_timer.start();
this->scene_manager.load_next_scene();