nngn
nngn

https://bbguimaraes.com/nngn

Game/graphics/physics engine.

Building

All targets use autotools. For a native binary, simply execute:

./configure
make

See dependencies for the required packages.

emscripten

A WebAssembly application can be built using emscripten. It provides all dependencies listed below, except for one that must be built from source. See scripts/emscripten/build.sh for the steps to do that.

Then, follow the autotools process, prefixing configure with emconfigure. pkg-config doesn't currently work with it, but the scripts/emscripten/pkgconfig directories has dummy files that can be used:

EM_PKG_CONFIG_PATH=scripts/emscripten/pkgconfig emconfigure ./configure
make

dependencies

These are the required packages for building the main program, along with the versions known to work:

  • lua (5.3.5): embedded scripting language
  • sol (3.2.0): c++/lua wrapper

The default build of the program is very minimal. Additional functionality can be enabled by passing extra flags to the configure script.

See scripts/container.sh for an example script that creates a container with all the build dependencies.

<tt>--with-opencl</tt>

Enables the OpenCL compute backend. Requires:

  • OpenCL (2.2): heterogeneous computing library

<tt>--with-opengl</tt>

Enables the OpenGL graphics backend. Requires:

  • glfw (3.3): portable GUI library
  • gl (4.5, 3.1es): graphics library
  • glew (2.1.0): OpenGL extension loading library

<tt>--with-vulkan</tt>

Enables the Vulkan graphics backend. Requires:

  • glfw (3.3): portable GUI library
  • vulkan (1.1.130): graphics library
  • shaderc (2019.0): GLSL compiler

<tt>--with-libpng</tt>

Enables loading images. Requires:

  • libpng (1.6.37): PNG loading library

<tt>--with-freetype2</tt>

Enables loading fonts. Requires:

  • freetype2 (2.10.1): font library

tests

Building the tests requires Qt5Core and Qt5Test (5.14.0) and can be enabled with the --enable-tests flag. A clang-tidy check is also available via make tidy.

The shell script scripts/check.sh builds and executes the tests in a variety of configurations and using several code sanitizers. Refer to the script for more information. Beware that a full execution takes a long time (usually about an hour).

benchmarks

Building the benchmakrs requires Qt5Core and Qt5Test (5.14.0) and can be enabled with the --enable-benchmarks flag.

tools

Buildings auxiliary tools requires Qt5Widgets, Qt5Charts, and rustc (1.41.1) and can be enabled with the --enable-tools flag.