Skip to content
Download

SDK and build

Brasa comes with an SDK: the headers (brasa/*.hpp) and the engine’s libraries, already compiled. Your game is compiled against this SDK, so you don’t recompile the engine, only your code.

  1. Saves the project.
  2. Generates a CMakeLists.txt and a main.cpp in the project’s .brasa/ folder, with all your .cpp files.
  3. Configures the build with CMake, the first time or when something changed. It’s the configurar step in the progress box.
  4. Compiles with the C++ compiler from the Visual Studio Build Tools (MSVC). The executable ends up in .brasa/build/RelWithDebInfo/game.exe.
  5. Opens the game pointing at the project’s folder: the rooms, sprites and sounds are read straight from there.

From the second compilation on, it only recompiles the files that changed.

Everything inside .brasa/ is generated. It can be deleted without losing anything: the next Play recreates it. The .gitignore that Brasa creates already leaves this folder out of Git.

After updating Brasa, Play notices that the engine changed and redoes the build from scratch by itself, with the new headers and libraries. If something still goes wrong, delete the .brasa/ folder and press Play again.

Play, creating the project and brasa_cli generate:

  • .vscode/c_cpp_properties.json, with a configuration called Brasa that points to the SDK’s headers, in C++20;
  • .vscode/extensions.json, which recommends Microsoft’s C/C++ extension.

If you already had a c_cpp_properties.json, only the Brasa configuration is updated; the rest stays as it was.

  • C++ compiler (MSVC) and CMake, which come in the Visual Studio Build Tools. The Brasa installer checks and offers to install them.
  • The editor’s status bar shows SDK ok and CMake ok when everything is fine. The CMake path can be set in Projeto › Preferências… (Project › Preferences).

Problems? See Common problems.