Application. You subclass Prisma::Application, implement the required lifecycle hooks, and expose a CreateApplication() factory function that the engine entry point calls to construct your game. The engine takes ownership of the returned pointer and drives all callbacks from the main loop.
ApplicationSpecification
Fill inApplicationSpecification before constructing your subclass to configure the initial window and rendering parameters.
std::string
Application display name. Appears in the window title bar. Defaults to
"Prisma App".std::string
Relative path to the scene file loaded at startup. Leave empty to start with no scene. Defaults to
"".uint32_t
Initial window width in pixels. Defaults to
1280.uint32_t
Initial window height in pixels. Defaults to
720.bool
Start in fullscreen mode. Defaults to
false.bool
Allow the window to be resized by the user. Defaults to
true.Prisma::Graphic::PresentMode
Swap-chain presentation mode. Defaults to
PresentMode::VSync.uint32_t
Frame-rate cap.
0 means uncapped. Defaults to 0.Application class
Required override
OnInitialize
0 to signal success. Any non-zero return aborts startup and triggers shutdown.
Optional lifecycle overrides
OnShutdown
OnUpdate
ts carries the elapsed time since the last frame. Drive game logic, physics queries, and ECS world updates from here.
Prisma::Timestep
Time elapsed since the previous frame. Use
ts.GetSeconds() or ts.GetMilliseconds() to read the delta as a float.OnRender
OnUpdate(), dedicated to submitting draw commands. Keep rendering code here and update-logic code in OnUpdate() to maintain a clean separation.
OnImGuiRender
OnRender() when the ImGui debug UI is active (editor and debug builds). Issue ImGui widgets here.
OnEvent
OnUpdate(). Use EventDispatcher to handle specific event types.
Prisma::Event&
The platform event. Cast to a concrete type with
EventDispatcher or event_cast<T>.ShouldCloseOnWindowClose
false to keep the engine running after the window is closed — useful for headless servers or custom shutdown flows. Defaults to true.
State control
Close() signals the engine to exit the main loop after the current frame completes. IsRunning() reflects whether Close() has been called yet.
Layer system
Applications support aLayerStack for organizing subsystems or editor panels:
OnUpdate, OnRender, and OnEvent calls in stack order. Overlays are pushed on top and processed last.
ECSApplication
For ECS-driven games, prefer subclassingECSApplication instead of Application directly. It embeds a Core::ECS::World and overrides OnUpdate() to drive all registered systems automatically.
CreateApplication factory
Every executable must define this free function. The engine calls it once during startup:The engine wraps the raw pointer in a
std::unique_ptr<Application> immediately after CreateApplication() returns. Do not delete the returned object yourself.