From 0d445685bd8a66f03f4b7e1a203c724fd3d5164d Mon Sep 17 00:00:00 2001 From: maelstrom Date: Mon, 25 Nov 2024 21:51:17 +0100 Subject: [PATCH] Moved crucial code away from main.cpp --- src/common.cpp | 6 ++++++ src/common.h | 8 ++++++++ src/main.cpp | 5 ++--- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 src/common.cpp create mode 100644 src/common.h diff --git a/src/common.cpp b/src/common.cpp new file mode 100644 index 0000000..8803d6c --- /dev/null +++ b/src/common.cpp @@ -0,0 +1,6 @@ +// TEMPORARY COMMON DATA FOR DIFFERENT INTERNAL COMPONENTS + +#include "common.h" + +Camera camera(glm::vec3(0.0, 0.0, 3.0)); +std::vector parts; diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..b52fa65 --- /dev/null +++ b/src/common.h @@ -0,0 +1,8 @@ +#pragma once +#include "part.h" +#include "camera.h" + +// TEMPORARY COMMON DATA FOR DIFFERENT INTERNAL COMPONENTS + +extern Camera camera; +extern std::vector parts; diff --git a/src/main.cpp b/src/main.cpp index ba55a5b..9b84822 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,10 +13,9 @@ #include "physics/simulation.h" #include "camera.h" -void errorCatcher(int id, const char* str); +#include "common.h" -Camera camera(glm::vec3(0.0, 0.0, 3.0)); -std::vector parts; +void errorCatcher(int id, const char* str); int mode = 0;