Brenta Engine 1.1
Loading...
Searching...
No Matches
Building

The engine is written entirely in C++ and uses CMake as the build system. In this section we will guide you through the process of building the engine.

Supported Platforms

Currently, the only officially supported platform is Linux. The developer is aiming to release the engine on Windows and MacOS in the future. If you want to contribute to this issue, feel free to do so and check out the Contributing page. This guide will go through the process on a linux system.

Dependencies

The engine has the following dependencies:

  • gcc compiler
  • CMake
  • GLFW: window and input handling
  • librefreetype: text rendering
  • libassimp: model loading
  • SDL3: audio driver

In addition, the following programs are optional:

  • Doxygen: to generate the documentation
  • cmake-format: code formatter

You may or may not have the libraries available in your packet manger, if not you will need to build them from source. This guide will show you an example of building libassimp.

Nix

If you are using Nix, a development shell is provided in the repository. You can enter the shell by running the following command:

nix develop

You should now have all the dependencies installed and ready to build the engine.

Building libassimp

You need libassimp to load 3D models. To build it from source, first clone the repository:

git clone https://github.com/assimp/assimp.git

You can build the library with the following commands:

cd assimp/
cmake CMakeLists.txt -DASSIMP_WARNINGS_AS_ERRORS=off -DASSIMP_INSTALL=off
make -j4

The library will be generated in lib/. If you don't install the library system-wide (ASSIMP_INSTALL=off), you need to specify the path in an environment variable to run the application, like so:

LD_LIBRARY_PATH=${PWD}/lib/:${LD_LIBRARY_PATH} ./build/main.out

Likewise, you can build the other dependencies from source.

Compiling the Game

To compile the demo game, run the following commands:

cmake -Bbuild
cmake --build build

The binaries will be generated in the build/ directory.

Run the game with:

./build/main

Building documentation

You can build the documentation with doxygen (you need to have doxygen installed in your system):

doxygen doxygen.conf

The index will be located in docs/html/index.html.

Format code

To execute the formatter, run:

make format

Tests

The engine uses It's own testing framework, valFuzz. To build tests, run:

cmake -Bbuild -DBRENTA_BUILD_TESTS=ON
cmake --build build -j 4
./buid/tests --no-multithread

Examples

There is an examples directory, you can run an exmple with the following command:

cmake -Bbuild -DBRENTA_BUILD_EXAMPLES=ON
cmake --build build -j 4 --target load_model
./build/load_model

Change target to the example you want to compile