Skip to content
bg2 engine

Getting Started with C++

This section describes how to build and run the bg2 engine native (C++) API. The engine uses CMake as its build system and relies on platform-specific toolchains.

You can get the source code for the C++ API from the official repository:

Terminal window
git clone https://github.com/ferserc1/bg2e-native

The engine depends on:

  • SDL2
  • Vulkan SDK
  • GLM

Dependency installation differs per platform.


  • Xcode (version 15 or higher)
  • CMake ≥ 3.18
  • Vulkan SDK (including SDL2, GLM, Vulkan Memory Allocator)
Terminal window
cd bg2e-native
cmake -S . -B build -G Xcode
cmake --build build

On macOS, Xcode is the only supported generator. Other generators will build the project but will not correctly support native file dialogs.


  • Visual Studio 2022 (Desktop C++ development)
  • CMake ≥ 3.18
  • Vulkan SDK (including SDL2, GLM, Vulkan Memory Allocator)
Terminal window
cd bg2e-native
cmake -S . -B build -G "Visual Studio 17 2022"
cmake --build build

On Windows, Visual Studio 17 is the only supported generator.


Install dependencies using your package manager:

Terminal window
sudo apt update
sudo apt install build-essential cmake libsdl2-dev libgtk-3-dev libglm-dev ninja-build

Install Vulkan SDK manually and register environment variables:

Terminal window
source ~/vulkan_sdk/1.x.xxx/setup-env.sh
Terminal window
cd bg2e-native
cmake -S . -B build -G Ninja
cmake --build build

On Linux, Ninja is the recommended generator.


The build system requires the VULKAN_SDK path.

  • Normally, this is automatically provided by the environment
  • If not, pass it manually to CMake:
Terminal window
cmake -S . -B build -G Ninja -DVULKAN_SDK=/path/to/vulkan/sdk

The bg2 engine CMake project includes not only the core engine libraries but also a set of creation tools.

These tools are built as part of the same CMake project and can be compiled directly alongside the engine without any additional setup.

They are intended for:

  • Asset generation and processing
  • Scene and material authoring
  • Preparing data for runtime usage in both C++ and TypeScript APIs

To build the tools, simply compile the project as described above for your platform. The corresponding executables will be generated as part of the build output.