From 28da7de1220f5ac94a7da3614c6de7febbf3d74e Mon Sep 17 00:00:00 2001 From: Joeyrp Date: Tue, 31 Aug 2021 16:21:31 -0400 Subject: [PATCH] Adds beginnings of the README Adds Version class for working with symantic versioning. Also pulls the project version from the LunariumConfig.h file and makes it accessible from any point in the project. --- .gitignore | 1 + CMakeLists.txt | 1 + README | 43 +++++++++++++++++++++++++++++++++++++++++++ scripts/imgui.ini | 12 ------------ src/test_main.cpp | 13 +++++++------ 5 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 README delete mode 100644 scripts/imgui.ini diff --git a/.gitignore b/.gitignore index 2cf8ca4..a2c6edb 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ # other *.zip +*.ini test_data/test_save.xml ######################## CMAKE IGNORES diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a3d0a8..21fef1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ set(LUNARIUM_SRC "src/test_main.cpp" "src/core/core.cpp" "src/core/state.cpp" +"src/core/Version.cpp" "src/utils/Logger.cpp" "src/utils/HighResTimer.cpp" "src/utils/helpers.cpp" diff --git a/README b/README new file mode 100644 index 0000000..b96e4fe --- /dev/null +++ b/README @@ -0,0 +1,43 @@ +# Lunarium +Lunarium is a cross-platform 2D game engine. It runs in windows and Linux. It's tested on Windows 10 and Ubuntu (Kubuntu). + +# Building from source +Clone the repository with git and switch to the repository directory +``` + git clone https://github.com/` + cd lunarium +``` +## On Linux +Run the cmconfig.sh and then the build.sh. +``` + ./sripts/cmconfig.sh + ... + ./scripts/build.sh +``` +Note the scripts must be run from the root directory of the repo. +Finally you can use run.sh to run the program +``` + ./scripts/run.sh +``` + +## On Windows +Run the cmconfig.bat +``` + scripts\cmconfig.bat +``` +From here you can navigate to the build directory and run the LUNARIUM.sln file to build and run from inside Visual Studio. Or you can use build.bat to build from the command line. If you build from visual studio be sure to copy the test_data directory into the same directory with Lunarium.exe before running. +``` + scripts\build.bat +``` +Or for a Release build: +``` + scripts\build.bat r +``` +Then you can run the program: +``` + build\Debug\Lunarium +``` +OR +``` + build\Release\Lunarium +``` diff --git a/scripts/imgui.ini b/scripts/imgui.ini deleted file mode 100644 index a2f8136..0000000 --- a/scripts/imgui.ini +++ /dev/null @@ -1,12 +0,0 @@ -[Window][Debug##Default] -Pos=60,60 -Size=400,400 -Collapsed=0 - -[Window][Dear ImGui Demo] -Pos=650,20 -Size=550,680 -Collapsed=0 - -[Docking][Data] - diff --git a/src/test_main.cpp b/src/test_main.cpp index fbd17cd..4f0fc86 100644 --- a/src/test_main.cpp +++ b/src/test_main.cpp @@ -9,6 +9,7 @@ #include "utils/Logger.h" #include "utils/OpRes.h" #include "core/state.h" +#include "core/Version.h" extern "C" { @@ -32,9 +33,10 @@ int main(int argc, char** argv) // VERSION TEST std::cout << "Hello yall\n"; - std::cout << "This is " << argv[0] << " Version " << Lunarium_VERSION_MAJOR - << "." << Lunarium_VERSION_MINOR - << "." << Lunarium_VERSION_PATCH << '\n'; + // std::cout << "This is " << argv[0] << " Version " << Lunarium_VERSION_MAJOR + // << "." << Lunarium_VERSION_MINOR + // << "." << Lunarium_VERSION_PATCH << '\n'; + std::cout << "This is " << argv[0] << " Version " << lunarium::Version::GetVersion().ToString() << "\n"; glm::vec3 testVec = glm::vec3(1.0f, 2.0f, 3.0f); @@ -84,9 +86,9 @@ int main(int argc, char** argv) if (lunarium::IsOK(lunarium::State::CreateFromFile("test_data/test_state.xml", testState))) { std::cout << "\nIt worked! Full Screen Resolution Width: " << testState.Display.FullScreenResolution.Width; - std::cout << "\nSaveing out to test_save.xml"; + std::cout << "\nSaving out to test_save.xml"; - if (lunarium::IsOK(testState.SaveToFile("../test_data/test_save.xml"))) + if (lunarium::IsOK(testState.SaveToFile("test_data/test_save.xml"))) { std::cout << "\nSuccess!\n"; } @@ -94,7 +96,6 @@ int main(int argc, char** argv) { std::cout << "\nFailed to save the file...\n"; } - } std::cout << "\nTesting GLFW and ImGui\n";