From bbde646e46f8993fcf1f30ead6b7376f1670f389 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 5 Dec 2023 13:52:31 -0500 Subject: add runtime first pass --- runtime/CMakeLists.txt | 10 ++++++++++ runtime/main.cpp | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 runtime/CMakeLists.txt create mode 100644 runtime/main.cpp (limited to 'runtime') diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt new file mode 100644 index 0000000..24349aa --- /dev/null +++ b/runtime/CMakeLists.txt @@ -0,0 +1,10 @@ +project(pke_runtime VERSION 0.0) + +set(PKE_RUNTIME_SOURCE_FILES + main.cpp +) +add_executable(pke_runtime + ${PKE_RUNTIME_SOURCE_FILES} +) +target_link_libraries(pke_runtime PRIVATE pke) +target_include_directories(pke_runtime PRIVATE pke) diff --git a/runtime/main.cpp b/runtime/main.cpp new file mode 100644 index 0000000..c3b20b9 --- /dev/null +++ b/runtime/main.cpp @@ -0,0 +1,21 @@ + +#include + +#include "plugins.hpp" +#include "event.hpp" +#include "game.hpp" +#include "game-settings.hpp" +#include "window-types.hpp" + +void signal_handler(int signal_num) { + fprintf(stdout, "Received signal: %d - shutting down\n", signal_num); + pkeSettings.isGameRunning = false; +} + +int main(int argc, char *argv[]) { + signal(SIGTERM, signal_handler); + fprintf(stdout, "PKE_EDITOR ENTERING\n"); + Game_Main({}); + fprintf(stdout, "PKE_EDITOR EXITING\n"); + return 0; +} -- cgit v1.2.3