SDL_GetRendererProperties(3)
๐ SDL_GetRendererProperties ๐
okay so bestie, welcome to the SDL3 FUNCTIONS corner of the manual, and today's main character is SDL_GetRendererProperties โ she's the one who tells you literally everything the renderer is thinking. no cap.
โจ NAME โจ
SDL_GetRendererProperties โ get the properties associated with a renderer. that's it, that's the whole vibe. ๐
๐ธ SYNOPSIS ๐ธ
#include <SDL3/SDL_render.h>
SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer *renderer);
๐ฆ DESCRIPTION ๐ฆ
so SDL hands you a whole lil gift bag of read-only properties, and here's the full inventory, no skipping, we're going through all of it:
SDL_PROP_RENDERER_NAME_STRINGโ the name of the rendering driver ๐ท๏ธSDL_PROP_RENDERER_WINDOW_POINTERโ the window where rendering is displayed, if any ๐ชSDL_PROP_RENDERER_SURFACE_POINTERโ the surface where rendering is displayed, if this is a software renderer without a windowSDL_PROP_RENDERER_VSYNC_NUMBERโ the current vsync setting ๐งSDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBERโ the maximum texture width and height ๐SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTERโ a (const SDL_PixelFormat *) array of pixel formats, terminated withSDL_PIXELFORMAT_UNKNOWN, representing the available texture formats for this renderer. so like, a lil list that just... ends. iconic behavior honestly.SDL_PROP_RENDERER_TEXTURE_WRAPPING_BOOLEANโtrueif the renderer supportsSDL_TEXTURE_ADDRESS_WRAPon non-power-of-two textures. ๐ซSDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBERโ anSDL_Colorspacevalue describing the colorspace for output to the display, defaults toSDL_COLORSPACE_SRGB.SDL_PROP_RENDERER_HDR_ENABLED_BOOLEANโtrueif the output colorspace isSDL_COLORSPACE_SRGB_LINEARand the renderer is showing on a display with HDR enabled. bestie this one is shifty โ this property can change dynamically whenSDL_EVENT_WINDOW_HDR_STATE_CHANGEDis sent. keep an eye on her. ๐SDL_PROP_RENDERER_SDR_WHITE_POINT_FLOATโ the value of SDR white in theSDL_COLORSPACE_SRGB_LINEARcolorspace. When HDR is enabled, this value is automatically multiplied into the color scale. This property can change dynamically whenSDL_EVENT_WINDOW_HDR_STATE_CHANGEDis sent. โจSDL_PROP_RENDERER_HDR_HEADROOM_FLOATโ the additional high dynamic range that can be displayed, in terms of the SDR white point. When HDR is not enabled, this will be1.0. This property can change dynamically whenSDL_EVENT_WINDOW_HDR_STATE_CHANGEDis sent. ๐ฅ
๐ฎ With the direct3d renderer:
SDL_PROP_RENDERER_D3D9_DEVICE_POINTERโ theIDirect3DDevice9associated with the renderer
๐ฎ With the direct3d11 renderer:
SDL_PROP_RENDERER_D3D11_DEVICE_POINTERโ theID3D11Deviceassociated with the rendererSDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTERโ theIDXGISwapChain1associated with the renderer. This may change when the window is resized. ๐
๐ฎ With the direct3d12 renderer:
SDL_PROP_RENDERER_D3D12_DEVICE_POINTERโ theID3D12Deviceassociated with the rendererSDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTERโ theIDXGISwapChain4associated with the renderer.SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTERโ theID3D12CommandQueueassociated with the renderer
๐ฎ With the vulkan renderer:
SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTERโ theVkInstanceassociated with the rendererSDL_PROP_RENDERER_VULKAN_SURFACE_NUMBERโ theVkSurfaceKHRassociated with the rendererSDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTERโ theVkPhysicalDeviceassociated with the rendererSDL_PROP_RENDERER_VULKAN_DEVICE_POINTERโ theVkDeviceassociated with the rendererSDL_PROP_RENDERER_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBERโ the queue family index used for renderingSDL_PROP_RENDERER_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBERโ the queue family index used for presentationSDL_PROP_RENDERER_VULKAN_SWAPCHAIN_IMAGE_COUNT_NUMBERโ the number of swapchain images, or potential frames in flight, used by the Vulkan renderer ๐
๐ฎ With the gpu renderer:
SDL_PROP_RENDERER_GPU_DEVICE_POINTERโ theSDL_GPUDeviceassociated with the renderer
๐ซถ FUNCTION PARAMETERS ๐ซถ
rendererโ the rendering context. that's your girl right there ๐
โญ RETURN VALUE โญ
Returns a valid property ID on success or 0 on failure; call SDL_GetError() for more information. so if you get a 0, bestie, go ask SDL_GetError() what's wrong, she always spills the tea. ๐ญ
๐ง THREAD SAFETY ๐ง
It is safe to call this function from any thread. yes queen, thread-safe, go off from wherever you're standing ๐โ๏ธ๐จ
๐ AVAILABILITY ๐
This function is available since SDL 3.2.0. periodt.
๐ SEE ALSO ๐
no extra reading list on this one bestie, this page is self-sufficient and honestly? that's the energy. ๐
and that's a wrap on the Simple Directmedia Layer docs, SDL 3.4.18 era, from the SDL3 FUNCTIONS crew ๐ โ go forth and read your properties, you're doing amazing sweetie ๐โจ๐ฆ
๐ฆ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms