From d56ef32202ea5180aa8d1308418946d5467adf40 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 28 Nov 2023 16:55:20 -0500 Subject: make pke a library and the editor its own executable --- editor/CMakeLists.txt | 10 ++++++++++ editor/main.cpp | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 editor/CMakeLists.txt create mode 100644 editor/main.cpp (limited to 'editor') diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt new file mode 100644 index 0000000..0b1c228 --- /dev/null +++ b/editor/CMakeLists.txt @@ -0,0 +1,10 @@ +project(pke_editor VERSION 0.0) + +set(PKE_EDITOR_SOURCE_FILES + main.cpp +) +add_executable(pke_editor + ${PKE_EDITOR_SOURCE_FILES} +) +target_link_libraries(pke_editor PRIVATE pke imguidocked) +target_include_directories(pke_editor PRIVATE pke imguidocked) diff --git a/editor/main.cpp b/editor/main.cpp new file mode 100644 index 0000000..0d4ef9f --- /dev/null +++ b/editor/main.cpp @@ -0,0 +1,20 @@ +#include + +#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; +} + +PKEWindowProperties windowProps{}; + +int main() { + signal(SIGTERM, signal_handler); + fprintf(stdout, "PKE ENTERING\n"); + Game_Main(&windowProps); + fprintf(stdout, "PKE EXITING\n"); + return 0; +} -- cgit v1.2.3