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.
Prisma::Graphic::RenderSystem is the engine subsystem that owns the GPU device, swap chain, resource manager, and active render pipeline. The engine constructs and registers it automatically during Engine::Initialize() — you access it through Engine::GetRenderSystem() rather than constructing it yourself. The system implements ISubSystem, so the engine drives its lifecycle and per-frame updates alongside all other subsystems.
RenderSystemDesc
RenderSystem is constructed from a RenderSystemDesc that specifies the graphics API, window target, and initial resolution.
The graphics API to use. See RenderAPIType below. Defaults to
RenderAPIType::Vulkan.Platform window handle —
HWND on Windows, ANativeWindow* on Android.Vulkan surface handle or
nullptr when using DirectX 12.Initial render target width in pixels. Defaults to
1600.Initial render target height in pixels. Defaults to
900.Enables API-level debug layers (D3D12 debug layer / Vulkan validation layers). Defaults to
true. Disable in release builds for performance.Enables extended validation reporting. Defaults to
true.Swap-chain presentation mode. Defaults to
PresentMode::VSync.Number of frames the CPU can run ahead of the GPU. Defaults to
3.Identifies this render system in debug tools and log output. Defaults to
"PrismaApp".RenderAPIType
Class overview
Lifecycle (ISubSystem)
Initialize
InitializeDevice()— selects and initialises the backend (DX12 or Vulkan), creates the swap chain.InitializeRenderResourceManager()— creates the resource factory and allocators.InitializeRenderPipelines()— constructs the default forward render pipeline.
0 on success or a non-zero error code on failure. A failure here aborts engine startup.
Shutdown
Update
BeginFrame().
Frame control
A typical frame calls these four methods in order:BeginFrame
EndFrame
Present
PresentMode. Blocks until a swap-chain slot is available when PresentMode::VSync is active.
Resize
OnEvent() handler when a window resize event is received.
New render target width in pixels.
New render target height in pixels.
Device access
GetDevice
nullptr and logs an error if called before Initialize().
GetRenderResourceManager
DX12ResourceFactory or VulkanResourceFactory). Use this for managed resource creation with automatic lifetime tracking.
Pipeline management
SetMainPipeline
ForwardPipeline at startup. Pass a DeferredPipeline or a custom IPipeline implementation to switch rendering strategies at runtime.
The new pipeline to use. Ownership is shared — the previous pipeline is destroyed when no other references to it exist.
GetMainPipeline
RenderSystem is alive and SetMainPipeline() has not replaced it.
Scene rendering
RenderScene
targetTexture to render to an off-screen texture instead of the swap chain back buffer.
The scene graph to render. All visible mesh renderers in the scene are submitted to the pipeline.
The camera providing the view and projection matrices for this frame.
Optional off-screen render target. When
nullptr (default), output goes to the swap-chain back buffer.Render pipeline architecture
The following diagram shows howRenderSystem sits in the broader rendering stack:
Renderer (high-level command API)
For code that wants to submit draw calls without touching the pipeline directly, use the staticRenderer API in src/engine/graphic/Renderer.h:
Renderer::BeginScene() sets the active camera, Submit() enqueues a RenderCommand, and EndScene() signals that no more commands will arrive this frame. The pipeline retrieves the queue via GetCommandQueue() and dispatches the GPU work.
The mesh geometry to draw.
The material (shader + textures + constants) to apply.
World-space transform matrix for this draw call.
Per-instance tint color. Defaults to opaque white
(1, 1, 1, 1).