diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-01-09 14:44:31 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-01-09 14:44:31 -0500 |
| commit | b76e309166f714b0a66fb4802f02e92a82d09082 (patch) | |
| tree | 44244fc0e6f873e1ccf6e1e95e2fec62fcec394a /editor/editor-main.cpp | |
| parent | b04fefe8ee0086bc1404c06b8351ecb4e942f151 (diff) | |
flatten file structure + rename
Diffstat (limited to 'editor/editor-main.cpp')
| -rw-r--r-- | editor/editor-main.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/editor/editor-main.cpp b/editor/editor-main.cpp new file mode 100644 index 0000000..2dee016 --- /dev/null +++ b/editor/editor-main.cpp @@ -0,0 +1,38 @@ +#include <csignal> + +#include "arg-handler.hpp" +#include "plugins.hpp" +#include "editor.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); + fflush(stdout); + fflush(stderr); + fprintf(stdout, "\rPKE_EDITOR ENTERING\n"); + fprintf(stderr, "\r"); + // setup + { + pkeSettings.isSimulationPaused = true; + pkeSettings.isShowingEditor = true; + LoadedPkePlugins.Push({ + .OnInit = PkeEditor_Init, + .OnTick = PkeEditor_Tick, + .OnTeardown = PkeEditor_Teardown, + .OnImGuiRender = PkeEditor_RecordImGui, + }); + } + // run + PkeArgs_Parse(argc, argv); + Game_Main({}, argv[0]); + fprintf(stdout, "PKE_EDITOR EXITING\n"); + return 0; +} |
