From 23196be83778973d9688cc5d465e4e4a16476568 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 12 Dec 2024 22:45:12 +0100 Subject: add documentation --- src/crepe/api/Engine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/crepe/api/Engine.cpp') 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(); } + + return EXIT_SUCCESS; } void Engine::setup() { - this->game_running = true; this->loop_timer.start(); this->scene_manager.load_next_scene(); -- cgit v1.2.3