SafiRenderer
One renderer per SafiApp. Owns the window, the SDL_GPUDevice, the depth texture, and the per-frame command buffer / render pass.
Types
Functions
safi_renderer_init
Creates the SDL window, requests an SDL_GPUDevice that accepts SPIR-V, MSL, and DXIL (so the same binary runs on any platform SDL supports), claims the window for the device, and creates a matching depth texture. Returns false on failure.
safi_renderer_shutdown
Releases the depth texture, unclaims the window, destroys the device and the window, and calls SDL_Quit.
safi_renderer_begin_frame
Acquires a command buffer, waits for the next swapchain texture, recreates the depth texture if the window was resized, and opens a render pass that clears color to dark blue and depth to 1.0. Returns false when the swapchain isn't ready (e.g. the window is minimised) — skip rendering for that frame.
safi_renderer_end_frame
Ends the render pass and submits the command buffer.
safi_renderer_backend_name
Returns "metal", "vulkan", "direct3d12", etc. Useful for SAFI_LOG_INFO("GPU: %s", ...).