![]() |
Lysa
0.0
Lysa 3D Engine
|
The Lysa engine is integrated as a CMake subdirectory rather than a pre-built library. add_subdirectory compiles the engine in-tree and makes the lysa_engine and lysa_engine_shaders targets available to the project:
Several feature flags can be set before the add_subdirectory call to control which engine subsystems are compiled:
| Variable | Default | Effect |
|---|---|---|
LUA_BINDING | OFF | Lua scripting bindings |
FORWARD_RENDERER | ON | Forward rendering pipeline |
DEFERRED_RENDERER | ON | Deferred rendering pipeline |
PHYSIC_ENGINE_JOLT | OFF | Jolt physics backend |
PHYSIC_ENGINE_PHYSX | OFF | PhysX physics backend |
DIRECTX_BACKEND | ON (Windows only) | DirectX 12 backend |
Engine shaders are compiled into ${LYSA_ENGINE_PROJECT_DIR}/shaders as part of the lysa_engine_shaders target. A custom target shaders_copy copies that directory into the project's own shaders/ folder, which is where the app://shaders virtual path resolves at runtime:
The build_target function encapsulates the boilerplate for creating an executable that uses C++ modules: it calls add_executable for plain .cpp sources, registers .ixx module interface files via FILE_SET CXX_MODULES, applies the engine's compile options, and links against lysa_engine:
The sample application is built with:
Note that .ixx module interface files and their .cpp implementation files are listed separately: interfaces go into MY_TARGET_MODULES (the CXX_MODULES file set), while plain translation units go into MY_TARGET_SRC.
Next : Engine context