Skip to main content
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.

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

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 the Prisma 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.
All available flags are defined in cmake/DeviceOptions.cmake. The most commonly used ones are:
Configure backends at CMake time rather than with runtime checks. Choosing the right preset (e.g., editor-windows-x64-debug) automatically enables the correct flags for your platform.

Native vs. cross-platform mode

The engine supports two input and audio modes:
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)