Getting started¶
Requirements¶
- CMake 3.30 or newer and Ninja.
- A compiler with C++26 support in CMake: Clang 18+, GCC 14+ or Apple Clang 17+.
- Client builds only: Python 3 with Jinja2, used by glad to generate the OpenGL loader.
- Linux client builds: the X11, OpenGL and audio development packages SDL3 needs.
python3 -m venv .venv && source .venv/bin/activate
pip install -r cmake/requirements.txt
Every library (SDL3, glad, GLM, stb, Asio, nlohmann-json, Catch2) is downloaded at configure time by CPM; nothing else has to be installed.
Build and test¶
cmake --preset client
cmake --build --preset client
ctest --preset client
| Preset | Contents |
|---|---|
client |
Every module and the tests |
server |
core, ecs, net and the tests, without SDL3 or OpenGL |
macos |
Client build generating OpenGL 4.1 |
sanitize |
Client build with AddressSanitizer and UndefinedBehaviorSanitizer |
Tip
If CMake does not find Jinja2, add -DPython_EXECUTABLE=$PWD/.venv/bin/python to
the first configure.
Use the engine in a game¶
include(FetchContent)
FetchContent_Declare(aegis2d
GIT_REPOSITORY https://github.com/Aegis2D-Dev/aegis2d.git
GIT_TAG master
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(aegis2d)
add_executable(my_game main.cpp)
target_link_libraries(my_game PRIVATE aegis2d::engine aegis2d::warnings)
aegis2d_stage_runtime(my_game)
A server-only game sets AEGIS2D_BUILD_CLIENT to OFF before
FetchContent_MakeAvailable.
Build this documentation¶
pip install -r docs/requirements.txt
mkdocs serve # http://127.0.0.1:8000, reloads on save
mkdocs build --strict # what CI runs
The API reference is generated separately: mkdir -p build && doxygen docs/Doxyfile,
then open build/doxygen/html/index.html.