Docs

Build Options

Doriax uses CMake for desktop editor/runtime builds and platform tooling for mobile, Apple, and web exports.

Common requirements

Requirement Notes
CMake 3.20 or newer
C++ compiler MSVC, GCC, Clang, or equivalent, capable of the selected DORIAX_CXX_STANDARD (C++17 by default)
Python 3 Used by code generation scripts
Platform SDK Required for Android, iOS, macOS, and web builds

Editor build

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target doriax-editor
cmake --install build --config Release --strip

DORIAX_CXX_STANDARD applies here too, building the editor and engine with it. It is independent of the standard a project selects: the editor compiles script plugins with the project's value regardless of how the editor itself was built.

Leave DORIAX_PHYSICS_2D and DORIAX_PHYSICS_3D on for the editor: it authors every component, and Play links against its engine library, so the editor needs both backends. They are meant for runtime builds.

On Windows the build also provides doriax-editor-cmd, the same editor linked as a console application for automation and terminal output. It is excluded from the default build, so request it by name:

cmake --build build --config Release --target doriax-editor-cmd

See Command-Line Tools.

Runtime build

cmake -S engine -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug

Scripting entry options

Option Effect
NO_CPP_INIT Disable the C++ startup entry point
NO_LUA_INIT Disable the Lua startup entry point

Engine/library options

Option Effect
DORIAX_SHARED Build the engine as a shared library when enabled
ENABLE_OPT Enable SPIR-V optimizer support when available
EMSCRIPTEN_THREAD_SUPPORT Enable pthread support for Emscripten builds

Runtime project options

Option Default Effect
DORIAX_VSYNC_ENABLED ON Synchronize supported desktop presentation backends to the display refresh rate. Set to OFF to request an uncapped build. macOS Metal remains synchronized.
DORIAX_WINDOW_WIDTH 960 Initial window width in pixels for desktop builds
DORIAX_WINDOW_HEIGHT 540 Initial window height in pixels for desktop builds
DORIAX_WINDOW_MODE 0 Initial window state: 0 windowed, 1 maximized, 2 fullscreen. The Sokol app backend has no maximized support and treats 1 as windowed.
DORIAX_WINDOW_RESIZABLE ON Allow resizing the window. Ignored by the Sokol app backend, whose windows are always resizable.
DORIAX_WINDOW_TITLE "Doriax" Window title-bar text
DORIAX_CXX_STANDARD 17 C++ standard for the engine and the game target. Accepts 17, 20 or 23 only — configuration fails on any other value.
DORIAX_PHYSICS_2D ON Build and link Box2D. OFF leaves out 2D bodies, joints and their Lua API. When on, the engine target also defines the DORIAX_PHYSICS_2D macro for the game.
DORIAX_PHYSICS_3D ON Build and link Jolt. OFF leaves out 3D bodies, joints and their Lua API. When on, the engine target also defines the DORIAX_PHYSICS_3D macro for the game.
DORIAX_ADMOB ON iOS only: link Google Mobile Ads and compile the AdMob adapter, defining the DORIAX_ADMOB macro. OFF leaves AdMob unavailable.
DORIAX_STOREKIT ON iOS only: compile the StoreKit 2 adapter, a Swift source that needs Swift 6.1 (Xcode 16.3 or later), defining the DORIAX_STOREKIT macro. OFF leaves InAppPurchase unavailable on iOS.
DORIAX_WEB_PORTAL none Web only: the game portal SDK built in for WebPortal: none, crazygames, poki, gamedistribution, yandex or youtube. Any other value fails configuration. A portal also defines DORIAX_WEB_PORTAL_<NAME>, like DORIAX_WEB_PORTAL_POKI.
DORIAX_WEB_PORTAL_GAME_ID "" Web only: the game ID of portals that need one, which is GameDistribution.

The editor writes these options into exported CMake projects from Project Settings (VSync, the Window settings, the C++ standard, the physics backends, iOS Google AdMob and App Store Purchases, and the web Game Portal). For a manually configured standalone runtime, override them at configure time:

cmake -S engine -B build-runtime \
  -DPROJECT_ROOT=/path/to/project \
  -DDORIAX_VSYNC_ENABLED=OFF \
  -DDORIAX_WINDOW_MODE=2 \
  -DDORIAX_WINDOW_TITLE="My Game" \
  -DDORIAX_CXX_STANDARD=23

Vulkan treats OFF as a request for Immediate presentation, with Mailbox and then FIFO as fallbacks according to surface support.

Graphics backend

Set GRAPHIC_BACKEND when configuring a standalone runtime project. The editor's Desktop export selector passes the corresponding value automatically; Web exports use gles3.

Option value Target
glcore Desktop OpenGL Core
gles3 OpenGL ES 3 / WebGL-style targets
d3d11 Windows Direct3D 11
metal macOS and iOS Metal
vulkan Vulkan (Linux and Windows)

On macOS, vulkan builds through MoltenVK but cannot run yet — see Vulkan backend.

The root editor build reads the same variable, but accepts only vulkan or glcore (Linux and Windows, defaulting to glcore); macOS is forced to metal. There it is a cached variable, so the build directory keeps the backend it was configured with until -DGRAPHIC_BACKEND= is passed again.

App backend

The target system selects the app backend, which handles the window, input, and main loop. Configure prints it as APP_BACKEND, but the value is informational: setting it has no effect.

Target system APP_BACKEND Platform code
Windows win platform/win: native Win32 window with a WGL (OpenGL), Vulkan, or D3D11 context
Linux, FreeBSD linux platform/linux: native X11 window with a GLX (OpenGL) or Vulkan context
macOS apple platform/mac: native Cocoa executable. With the Xcode generator and Metal, platform/apple builds an .app bundle instead
iOS apple platform/apple
Android android platform/android: GameActivity
Emscripten emscripten platform/emscripten

Generated artifacts

Artifact Generated from
shaders.h Shader sources processed by CMake shader generation
engine_api_suggestions.h Lua binding files parsed by generate_api_suggestions.py
Copied engine directory Editor export/build support

Engine capacity macros

Exported CMake projects receive compiler defines for the largest per-scene capacities the editor measured, each floored at the engine default in engine/core/Engine.h. Growing past the default lets large authored content compile; the floor keeps dynamically spawned content inside the known-safe baseline.

Macro Default Controls
MAX_SUBMESHES 16 Submeshes per mesh
MAX_TILEMAP_TILESRECT 200 Tilemap rectangle tiles
MAX_TILEMAP_TILES 2048 Tiles per tilemap
MAX_SPRITE_FRAMES 128 Sprite atlas frames
MAX_EXTERNAL_BUFFERS 30 External vertex/index buffers per mesh
MAX_BONES 128 Bone matrices per skinned mesh
MAX_MESH_LODS 4 Detail levels per mesh submesh (source plus simplified index ranges)

MAX_BONES is the CPU array size used at runtime. Skinned shaders bind those matrices through a storage buffer or a bone texture and do not embed this count. The editor can load skins larger than 128; export writes the raised value so the standalone build matches. If you load a larger skin only from code, edit the generated add_definitions("-DMAX_BONES=N") line in the exported CMakeLists (or pass the same compiler define in a standalone engine build).

Platform guides

See Building Overview, then use the guide for your target platform.