TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ProwlEngine/Prowl/llms.txt
Use this file to discover all available pages before exploring further.
Graphics class is the central hub for all low-level GPU operations in Prowl. It wraps a Veldrid GraphicsDevice, exposes the active rendering backend, and provides high-level helpers for drawing meshes, blitting textures, submitting recorded command buffers, and managing GPU resource lifetimes. Every operation that touches the GPU — from a simple texture blit to a full scene draw — flows through or is coordinated by this static class.
Graphics is a static partial class defined in Prowl.Runtime. It is initialised once at engine startup via Graphics.Initialize() and must not be used before that call.Core Device Properties
The active Veldrid
GraphicsDevice. Provides direct access to the underlying GPU abstraction layer. Use this for low-level Veldrid calls not covered by the higher-level helpers.Shorthand for
Device.ResourceFactory. Use it to create Veldrid resources such as Pipeline, ResourceLayout, DeviceBuffer, and Framebuffer.Returns
Device.SwapchainFramebuffer — the main window’s backbuffer. Render to this framebuffer to have output appear on screen.The current resolution of the swapchain framebuffer as a
Vector2Int(width, height).Gets or sets vertical synchronisation on the swapchain. Maps directly to
Device.SyncToVerticalBlank.Backend Detection
Prowl can run on multiple graphics backends. Use these flags to write backend-specific code.true when the active backend is Direct3D 11.true when the active backend is OpenGL or OpenGL ES.true when the active backend is Vulkan.Initialization
Initialize
GraphicsDevice using the window provided by Screen.InternalWindow. Must be called once at engine startup before any rendering work.
Whether to enable vertical synchronisation on the swapchain.
The preferred Veldrid backend. Prowl will attempt to create a device with this backend, falling back automatically if unavailable.
Drawing
DrawMesh
RenderPipeline’s renderable list and batched by material for efficient GPU submission.
Reference to the mesh asset to render.
Material (shader + properties) used to shade the mesh.
World-space transform matrix for the mesh.
Render layer index used for culling and layer-based render pass filtering.
Optional per-object shader property overrides. When provided, these values override the material’s own properties for this draw call only.
Blit
Texture2D to a Framebuffer, optionally through a full-screen material pass. Internally this acquires a CommandBuffer from the pool, records the blit, submits it, and releases the buffer — it is a fully self-contained, immediate operation.
The source texture to blit from.
The destination framebuffer to blit into.
Optional material to apply during blit. When
null, the internal default blit shader is used.Shader pass index to use from the material.
Command Submission
SubmitCommandBuffer
commandBuffer and submits its underlying Veldrid CommandList to the GPU. After submission the buffer is cleared and ready for reuse.
The command buffer to submit. Must have been in an active recording state.
Optional fence to signal when the GPU finishes executing the submitted commands. Use
WaitForFence to synchronise.SubmitCommandList
CommandList. Prefer SubmitCommandBuffer for higher-level usage.
GetCommandList
CommandList, calls Begin() on it, and returns it. Caller is responsible for ending and disposing the list.
A new, already-begun Veldrid
CommandList.Synchronisation
WaitForFence
fence, or until timeout nanoseconds elapses.
WaitForFences
waitAll is true, blocks until all fences are signalled; when false, returns as soon as any fence is signalled.
Frame Management
EndFrame
- Ticks the
RenderTexturepool (ages and destroys unused render textures) - Clears the active
RenderPipeline’s renderable and light lists - Resizes the swapchain if the window dimensions have changed
- Waits for the GPU to be idle
- Disposes all resources queued for deferred disposal
- Calls
Device.SwapBuffers()to present the frame
Projection Utilities
GetGPUProjectionMatrix
M22 = -M22) to account for Veldrid’s clip-space conventions. On OpenGL and Vulkan the matrix is returned unchanged.
The CPU projection matrix (e.g., the output of
Matrix4x4.CreatePerspectiveFieldOfView).The backend-adjusted projection matrix ready for upload to the GPU.
GetFrontFace
FrontFace.Clockwise on OpenGL and FrontFace.CounterClockwise on all other backends, reflecting winding order differences between APIs.