Pyramid Engine currently supports native 64-bit Windows builds with an open-source MinGW toolchain:
- Windows 10 or 11, x64;
- MSYS2 using the UCRT64 environment;
- MinGW-w64 GCC as the default compiler;
- optional Clang targeting the same MinGW-w64/UCRT runtime;
- Ninja;
- CMake 3.23 or newer;
- OpenGL 3.3 core or newer.
Visual Studio, MSVC, and the Visual Studio Build Tools are not required.
A normal configure on Linux or macOS fails immediately. PYRAMID_ALLOW_UNSUPPORTED_HOST_CONFIGURE is only for metadata validation; it does not make the Win32/WGL engine runnable on another platform.
Install MSYS2 to C:\msys64, then run from PowerShell:
./scripts/bootstrap-msys2.ps1 -Compiler gccTo install both GCC and Clang:
./scripts/bootstrap-msys2.ps1 -Compiler bothThe script installs the UCRT64 MinGW-w64 toolchain, CMake, and Ninja. It does not install Visual Studio or any codec middleware.
After setup, use either:
- the MSYS2 UCRT64 terminal; or
scripts/build-mingw.ps1from ordinary PowerShell.
Do not build from the plain MSYS shell. Its /usr compiler targets the MSYS POSIX runtime rather than native Windows.
Default GCC Debug build with tests:
./scripts/build-mingw.ps1 -Compiler gcc -Configuration DebugGCC Release:
./scripts/build-mingw.ps1 -Compiler gcc -Configuration ReleaseClang Debug:
./scripts/build-mingw.ps1 -Compiler clang -Configuration Debug| Configure preset | Build directory | Purpose |
|---|---|---|
gcc-debug |
build/gcc-debug |
GCC Debug engine and examples |
gcc-debug-tests |
build/gcc-debug-tests |
GCC Debug engine, examples, and tests |
gcc-release-tests |
build/gcc-release-tests |
GCC Release engine, examples, and tests |
clang-debug-tests |
build/clang-debug-tests |
Clang Debug engine, examples, and tests |
clang-release-tests |
build/clang-release-tests |
Clang Release engine, examples, and tests |
Run in MSYS2 UCRT64:
cmake --preset gcc-debug-tests
cmake --build --preset build-gcc-debug-tests
ctest --preset test-gcc-debugcmake --preset gcc-release-tests
cmake --build --preset build-gcc-release-tests
ctest --preset test-gcc-releasecmake --preset clang-debug-tests
cmake --build --preset build-clang-debug-tests
ctest --preset test-clang-debugClean configuration helper from PowerShell:
./scripts/configure-clean.ps1 -Preset gcc-debug-tests| Option | Default | Purpose |
|---|---|---|
PYRAMID_BUILD_EXAMPLES |
ON |
Build both graphical examples |
PYRAMID_BUILD_TESTS |
OFF |
Enable CTest and all maintained tests |
PYRAMID_WARNINGS_AS_ERRORS |
OFF |
Promote GCC/Clang warnings to errors |
PYRAMID_BUNDLE_MINGW_RUNTIME |
ON |
Copy MinGW runtime DLLs beside build and installed executables |
PYRAMID_ALLOW_UNSUPPORTED_HOST_CONFIGURE |
OFF |
Configure-only validation outside Windows |
Manual GCC configuration from UCRT64:
cmake -S . -B build/manual -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DPYRAMID_BUILD_EXAMPLES=ON \
-DPYRAMID_BUILD_TESTS=ON
cmake --build build/manual --parallel
ctest --test-dir build/manual --output-on-failureCTest registers 55 targets, including standalone owned-library tests plus API, platform, input, graphics, resource, spatial, scene, UI, international-text, and reference-game validation. List the exact graph with:
ctest --test-dir build/gcc-debug-tests -NThe standalone image suite covers PNG/DEFLATE plus baseline, progressive, grayscale, subsampled, restart-marker, malformed, and truncated JPEG inputs. The platform input contract is covered by Platform.InputState; generic actions, contexts, consumption, chords, and rebinding are covered by Input.ActionMapping; resize delivery is covered by Platform.WindowResizeEvents.
Key scene tests are:
Graphics.EntityScene: stable entity IDs, hierarchy, inherited visibility, mesh-renderer/light components, generated proxies, and recursive destruction;Graphics.SceneSerialization: deterministic version-2 entity/component persistence, manifest references, hierarchy validation, and missing/stale resource diagnostics;Graphics.CameraFrustum,Graphics.OctreeUpdates,Graphics.OctreeQueries,Graphics.NearestQueries,Graphics.OctreeConfiguration, andGraphics.OctreeCompaction: world-bound visibility and spatial behavior.
Resource tests cover mesh, shader, texture, and material resources/caches plus registry ownership, typed handles, and manifests. API.PublicApiLinkage turns missing public definitions into link failures. Tests that do not require a graphics context use fake devices/backends; renderer changes still require the graphical smoke test and visual inspection.
After building, run from PowerShell:
./scripts/run-smoke.ps1 -BuildDir build/gcc-debug-tests -DurationSeconds 5The script starts BasicGame and BasicRenderingExample, then fails if either exits abnormally during the requested interval. Visually inspect both windows after renderer changes. Verify the orbit and strategy camera controls after input or camera-controller changes.
Typical GCC Debug outputs:
build/gcc-debug-tests/bin/BasicGame.exe
build/gcc-debug-tests/bin/BasicRenderingExample.exe
build/gcc-debug-tests/lib/libPyramidEngined.a
PYRAMID_BUNDLE_MINGW_RUNTIME is enabled by default. CMake copies the MinGW runtime files required by GCC or Clang into the common output directory, and scripts/build-mingw.ps1 verifies the bundle after every build. You can therefore launch:
.\build\gcc-debug-tests\bin\BasicGame.exe
.\build\gcc-debug-tests\bin\BasicRenderingExample.exewithout adding C:\msys64\ucrt64\bin to PATH. Installation places the same runtime files in install/bin. Bundled assets such as bin/Fonts/*.pfont and bin/Assets/Models/* are resolved relative to the executable through Pyramid::Platform::ResolveRuntimePath, so launching build\...\bin\BasicGame.exe from another PowerShell directory or a shortcut is supported. Disable runtime-DLL bundling only for controlled packaging with -DPYRAMID_BUNDLE_MINGW_RUNTIME=OFF.
Build and launch an example in one command:
.\scripts\run-example.ps1 -Example BasicGame -Compiler gcc -Configuration DebugUse -SkipBuild to launch an existing build after rechecking the runtime bundle.
Build and install:
cmake --preset gcc-release-tests
cmake --build --preset build-gcc-release-tests
cmake --install build/gcc-release-tests --prefix installThe installation contains:
- public headers for the engine and all owned libraries;
- GLAD headers;
PyramidEngine,PyramidFoundation,PyramidMath,PyramidInput,PyramidImage,PyramidModel, andgladlibraries;- independent package metadata for each owned target;
- exported
Pyramid::Engine,Pyramid::Foundation,Pyramid::Math,Pyramid::Input,Pyramid::Image,Pyramid::Model, andPyramid::gladtargets.
Engine consumer:
find_package(PyramidEngine CONFIG REQUIRED)
target_link_libraries(MyTarget PRIVATE Pyramid::Engine)Standalone foundation, math, and input consumer:
find_package(PyramidFoundation CONFIG REQUIRED)
find_package(PyramidMath CONFIG REQUIRED)
find_package(PyramidInput CONFIG REQUIRED)
target_link_libraries(MyTool PRIVATE Pyramid::Foundation Pyramid::Math Pyramid::Input)Standalone image consumer:
find_package(PyramidImage CONFIG REQUIRED)
target_link_libraries(MyImageTool PRIVATE Pyramid::Image)Standalone model consumer:
find_package(PyramidModel CONFIG REQUIRED)
target_link_libraries(MyModelTool PRIVATE Pyramid::Model)Tests/Consumer, Tests/LibrariesConsumer, Tests/ImageConsumer, and Tests/ModelConsumer are the reference external consumers and are built independently by CI after installation. Every owned library can also be installed by its matching component name.
.github/workflows/windows-ci.yml uses MSYS2 UCRT64 and validates four combinations:
- GCC Debug;
- GCC Release;
- Clang Debug;
- Clang Release.
Each combination configures, builds, runs CTest, installs all packages, builds independent engine, foundation/math/input, image, and model find_package consumers, and runs all consumers. No Visual Studio installation is used by the workflow.
Open MSYS2 UCRT64, not the plain MSYS shell, or use scripts/build-mingw.ps1 from PowerShell. Rerun scripts/bootstrap-msys2.ps1 if the packages are missing.
You are using an old CMakePresets.json or an old build directory. Pull/copy the updated files and remove the old build directory:
Remove-Item build -Recurse -ForceThen use gcc-debug-tests, not vs2022-debug-tests.
Update the GPU driver and confirm OpenGL 3.3 core support. The window layer attempts versions from 4.6 down to 3.3 and rejects legacy fallback contexts.
The bundled engine shaders and examples use GLSL 3.30. Inspect the shader log and the reported OpenGL/GLSL versions.
Development builds resolve checked-in shaders using the compile-time source root. Copying only an executable away from the repository can break this lookup.
Close running examples and any terminal/debugger using the output files, then rerun scripts/configure-clean.ps1.
After a normal build, regenerate both Ruqoom-owned reference TTFs and their deterministic 64-pixel SDF processed atlases with:
python .\scripts\regenerate-reference-fonts.py `
--compiler .\build\gcc-debug-tests\bin\PyramidFontCompiler.exeVerify that the checked-in source and processed assets reproduce byte-for-byte without modifying them:
python .\scripts\regenerate-reference-fonts.py `
--compiler .\build\gcc-debug-tests\bin\PyramidFontCompiler.exe `
--checkThe reference atlases are baked as 64-pixel signed-distance fields. UIRenderer uses screen-space derivatives and semantic optical weights so the same atlas remains crisp at the 16–25 pixel logical sizes used by BasicGame. On Windows, BasicGame may also create a content-addressed SDF cache from installed Segoe UI, Tahoma, or Arial outlines under the per-user cache directory; delete that cache only when intentionally forcing a rebuild.