summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-11-28 16:55:20 -0500
committerJonathan Bradley <jcb@pikum.xyz>2023-11-28 16:55:20 -0500
commitd56ef32202ea5180aa8d1308418946d5467adf40 (patch)
tree493adb247a59e971ad78a6558c0c0d609282a40f /editor
parent6d9bea3e71137a94ba64fd0b5661d341304b2dc1 (diff)
make pke a library and the editor its own executable
Diffstat (limited to 'editor')
-rw-r--r--editor/CMakeLists.txt10
-rw-r--r--editor/main.cpp20
2 files changed, 30 insertions, 0 deletions
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 <csignal>
+
+#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;
+}