Cosmic Explorer is a simple 2D Solar System renderer and explorer written in C++. It is powered by the ImGUI interface library.
The project now has a WebAssembly build target! Feel free to check out the program without compiling it here.
This project uses CMake for build file generation. Building is currently only tested against Linux and Windows.
You need to install the SDL2 and cmake packages using your distro's package manager. For example, on Ubuntu and Debian:
$ apt install libsdl2-dev cmake
Use cmake to generate a makefile and compile. Example:
$ mkdir build && cd build
$ cmake ..
$ make
OR:
$ cmake --build .
You must have SDL2 installed in Visual Studio's default lib, include, bin directories (or anywhere that the cmake/FindSDL2.cmake
script is able to find it in). You may simply open the repository with Visual Studio 2019 and run automated cmake generation, then set the root CMakeLists.txt
as build target.
Optionally, you may use the "Developer Command Prompt for VS 2019" shortcut to generate and compile in the command-line:
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ..
Building:
ninja
The pre-packaged VS Code settings demonstrate a working commandline configure-and-build setup.
Instructions similar to Linux, with the exception that you will want to override the cmake default build system:
$ mkdir build && cd build
$ cmake -G "MSYS Makefiles" ..
You will need to install SDL2 64-bit. Example on MSYS:
$ pacman -S mingw-w64-x86_64-SDL2
$ mingw32-make
This project supports a WASM compile target. You must have the Emscripten suite installed and configured to build to WASM.
emconfigure cmake ..
emmake make
emmake make install
Unit tests use doctest. To run, you may do:
$ cd bin
$ ./tests/vec2
$ ./tests/entity
...
OR, through CTests:
$ make test ARGS=-j4
$ ctest . j4