Prisma Engine is built around a layered, modular architecture that cleanly separates your game code from platform-specific details. The engine compiles only the backends your target platform needs, wires them together through well-defined interfaces, and exposes a single consistent API to your application regardless of whether it runs on Windows, Linux, or Android.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Excurs1ons/PrismaEngine/llms.txt
Use this file to discover all available pages before exploring further.
Layered architecture
Three distinct layers form the engine’s structure. Each layer depends only on the one below it, never on concrete platform implementations directly.The Driver-Device pattern
The Driver-Device pattern is the central design decision in Prisma Engine. It applies to the audio and input subsystems and will be extended to other subsystems as the engine matures. Driver — a thin adapter that implements a pure-virtual interface (IAudioDriver, IInputDriver) and talks directly to one platform API (XAudio2, AAudio, SDL3, etc.). Drivers contain no high-level logic; they only translate engine calls into platform calls.
Device — a platform-agnostic class (AudioDevice, InputDevice) that owns a driver and builds useful features on top of it: 3D audio positioning, action mapping, text input state, and so on. Your game code calls Device methods and never touches a Driver directly.
Adding support for a new platform means writing one new Driver implementation. The Device, and all game code that uses it, remain unchanged.
Design principles behind the pattern
| Principle | How the engine applies it |
|---|---|
| Single responsibility | Drivers handle platform API calls. Devices handle high-level logic. |
| Interface segregation | Driver interfaces are minimal — only the methods each consumer needs. |
| Dependency inversion | Devices depend on the interface, never on a concrete driver class. |
| Open/closed | New platforms require a new driver file only, no changes to existing code. |
Key subsystems
Rendering
DirectX 12 (Windows), Vulkan (Windows, Linux, Android), and OpenGL (Linux fallback). Forward and deferred render pipelines with HLSL and GLSL shader support.
Audio
SDL3 cross-platform backend. XAudio2 and AAudio native backends exist but are pending an interface refactor. Configured via
PRISMA_ENABLE_AUDIO_* CMake options.Entity Component System
Data-oriented ECS with typed component pools, system scheduling, and a singleton
World. Game logic lives in systems; data lives in components.Resource management
Thread-safe
AssetManager with JSON and Base64+zstd binary serialization. Supports textures, meshes, tilemaps (TMX), and cubemaps.Project structure
Namespace conventions
All engine code lives under thePrisma namespace. Subsystems use nested namespaces:
Conditional compilation with PRISMA_ENABLE_*
Engine modules are gated behind CMake feature flags that become preprocessor defines. This keeps platform-specific code out of binaries that don’t need it.
cmake/DeviceOptions.cmake. The most commonly used ones are:
| Flag | Default | Description |
|---|---|---|
PRISMA_ENABLE_RENDER_DX12 | ON (Windows) | DirectX 12 rendering backend |
PRISMA_ENABLE_RENDER_VULKAN | ON (Android) | Vulkan rendering backend |
PRISMA_ENABLE_RENDER_OPENGL | OFF | OpenGL fallback backend |
PRISMA_ENABLE_AUDIO_SDL3 | ON | SDL3 cross-platform audio |
PRISMA_ENABLE_IMGUI_DEBUG | ON (Debug) | ImGui editor overlay |
Native vs. cross-platform mode
The engine supports two input and audio modes:- Native mode (default)
- Cross-platform mode (SDL3)
Platform-specific APIs are used directly for best performance and integration:
- Windows: DirectX 12 rendering, XInput gamepad, RawInput keyboard/mouse
- Android: Vulkan rendering, GameActivity input, AAudio (planned)
- Linux: Vulkan or OpenGL rendering (in development)