Building TRAP™#

Requirements#

TRAP™ Engine requires a GPU that is Vulkan 1.1 or newer compatible.

Please install the VulkanSDK.

If you want to be able to build the documentation and to update the Vulkan loader you need to install Python 3.

Please install the VulkanSDK and make sure that the VULKAN_SDK environment variable is set properly.

TRAP™ also depends on some X11 and Wayland development packages.
To install those run the following command in a terminal:

sudo apt install xorg-dev libwayland-dev libxkbcommon-dev wayland-protocols

or to only install the required packages

sudo apt install libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libwayland-dev libxkbcommon-dev wayland-protocols

Make sure that the Wayland Scanner can be used from Terminal via wayland-scanner command.

If you want to be able to build the documentation and to update the Vulkan loader you need to install Python 3 and Sphinx. Make sure Python 3 and Sphinx can be used from Terminal via the python and sphinx-build commands.

Cloning the repository#

Clone the repository with git clone --recursive https://github.com/GamesTrap/TRAP.

Note

If the repository has already been cloned non-recursively, use git submodule update --init --recursive to clone the necessary submodules.

Project generation#

TRAP™ uses Premake 5 as a build generation tool. By default it is shipped with the TRAP™ repository.

You can generate project files for Visual Studio 2022, Visual Studio Code, Codelite, Make and Ninja.

You can generate project files for Visual Studio Code, Codelite, Make and Ninja.

Just run the appropriate generator script inside the GeneratorScripts folder.

Generate documentation#

Important

Python 3 is required in order to build the documentation.

To update the documentation run the GenerateDocumentation script inside the GeneratorScripts folder.

Update controller mappings#

To update the controller mappings database run the GenerateControllerMappings script inside the GeneratorScripts folder.

Update Vulkan loader#

Important

Python 3 is required in order to update the Vulkan loader.

To update the Vulkan loader run the GenerateVulkanLoader script inside the GeneratorScripts folder.

Additional libraries#

To install the Discord Game SDK do the following:

  1. Download the Discord Game SDK

  2. Extract the contents of the downloaded SDK to the Dependencies/DiscordGameSDK folder.

TRAP™ will then automatically detect if the Discord Game SDK is installed properly on the next run of any of the GenerateProject scripts inside the GeneratorScripts folder.

If everything went right, feel free to use the TRAP::Utils::Discord namespace.

To install the NVIDIA® Nsight™ Aftermath SDK do the following:

  1. Create an account on the NVIDIA Developer site.

  2. Download the NVIDIA® Nsight™ Aftermath SDK.

  3. Extract the contents of the downloaded SDK to the Dependencies/Nsight-Aftermath folder.

TRAP™ will then automatically detect if the NVIDIA® Nsight™ Aftermath SDK is installed properly on the next run of any of the GenerateProject scripts inside the GeneratorScripts folder.

If everything went right, feel free to use the ENABLE_NSIGHT_AFTERMATH macro in Base.h to enable Nsight-Aftermath in debug builds.

To install the Steamworks SDK do the following:

  1. Create an account on the Steamworks website.

  2. Download the Steamworks SDK.

  3. Extract the contents of the downloaded SDK to the Dependencies/SteamworksSDK folder.

TRAP™ will then automatically detect if the Steamworks SDK is installed properly on the next run of any of the GenerateProject scripts inside the GeneratorScripts folder.

If everything went right, feel free to use the TRAP::Utils::Steam namespace.

To install the NVIDIA® Reflex SDK do the following:

  1. Create an account on the NVIDIA Developer site.

  2. Download the NVIDIA® Reflex SDK.

  3. Extract the contents of the downloaded SDK to the Dependencies/NVIDIA-Reflex folder.

TRAP™ will then automatically detect if the NVIDIA® Reflex SDK is installed properly on the next run of any of the GenerateProject scripts inside the GeneratorScripts folder.

If everything went right, feel free to use TRAP::Graphics::RendererAPI::SetLatencyMode() and other NVIDIA® Reflex related functions.