Skip to content

A simple 2D solar system explorer written in C++, powered by SDL and ImGui

License

Notifications You must be signed in to change notification settings

Doohl/Cosmic-Explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cosmic Explorer

Build Status

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.

UI example

Building the Code

This project uses CMake for build file generation. Building is currently only tested against Linux and Windows.

Linux

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 .

Windows

Visual Studio 2019

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.

MSYS / MinGW32

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

Emscripten (WASM)

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 Testing

Unit tests use doctest. To run, you may do:

$ cd bin
$ ./tests/vec2
$ ./tests/entity
...

OR, through CTests:

$ make test ARGS=-j4
$ ctest . j4

About

A simple 2D solar system explorer written in C++, powered by SDL and ImGui

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages