SDL_CREATERENDERERWITHPROPERTIES(3)
โจ SDL_CreateRendererWithProperties โจ
okay bestie, welcome to the SDL3 function zone ๐ this one lives in SDL_CreateRendererWithProperties(3) and it's literally the glow-up version of making a 2D rendering context for a window โ except you get to hand it a whole lil bag of properties instead of boring positional args. main character energy fr fr ๐
๐ธ NAME ๐ธ
SDL_CreateRendererWithProperties โ Create a 2D rendering context for a window, with the specified properties. โจ
๐ฆ SYNOPSIS ๐ฆ
#include <SDL3/SDL_render.h>
SDL_Renderer * SDL_CreateRendererWithProperties(SDL_PropertiesID props);
๐ DESCRIPTION ๐
so basically you pass in a props ID and it reads a whole vibe board of properties off it. here's the full list, no skipping, no gatekeeping ๐ซถ
SDL_PROP_RENDERER_CREATE_NAME_STRINGโ the name of the rendering driver to use, if you want a specific one ๐SDL_PROP_RENDERER_CREATE_WINDOW_POINTERโ the window where rendering is displayed. required if this isn't a software renderer using a surface ๐ชSDL_PROP_RENDERER_CREATE_SURFACE_POINTERโ the surface where rendering is displayed, if you want a software renderer without a window ๐จSDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBERโ anSDL_Colorspacevalue describing the colorspace for output to the display, defaults toSDL_COLORSPACE_SRGB. thedirect3d11,direct3d12, andmetalrenderers supportSDL_COLORSPACE_SRGB_LINEAR, which is a linear color space and supports HDR output ๐. if you selectSDL_COLORSPACE_SRGB_LINEAR, drawing still uses the sRGB colorspace, but values can go beyond1.0and float (linear) format textures can be used for HDR content. it's giving โจextra rangeโจSDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBERโ non-zero if you want present synchronized with the refresh rate. this property can take any value that is supported bySDL_SetRenderVSync()for the renderer ๐ง
๐ฎ With the SDL GPU renderer (since SDL 3.4.0) ๐ฎ
SDL_PROP_RENDERER_CREATE_GPU_DEVICE_POINTERโ the device to use with the renderer, optional.SDL_PROP_RENDERER_CREATE_GPU_SHADERS_SPIRV_BOOLEANโ the app is able to provide SPIR-V shaders toSDL_GPURenderState, optional.SDL_PROP_RENDERER_CREATE_GPU_SHADERS_DXIL_BOOLEANโ the app is able to provide DXIL shaders toSDL_GPURenderState, optional.SDL_PROP_RENDERER_CREATE_GPU_SHADERS_MSL_BOOLEANโ the app is able to provide MSL shaders toSDL_GPURenderState, optional.
๐ With the vulkan renderer ๐
SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTERโ theVkInstanceto use with the renderer, optional.SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBERโ theVkSurfaceKHRto use with the renderer, optional.SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTERโ theVkPhysicalDeviceto use with the renderer, optional.SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTERโ theVkDeviceto use with the renderer, optional.SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBERโ the queue family index used for rendering.SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBERโ the queue family index used for presentation.
๐ FUNCTION PARAMETERS ๐
propsโ the properties to use.
๐ RETURN VALUE ๐
Returns a valid rendering context, or NULL if there was an error ๐ญ (we hate to see it). call SDL_GetError() for more information โ she'll tell you what went wrong, no cap.
๐ง THREAD SAFETY ๐ง
This function should only be called on the main thread. do not try to be sneaky with it on another thread bestie, it's not built for that ๐
โญ AVAILABILITY โญ
This function is available since SDL 3.2.0. โจ
๐ SEE ALSO ๐
SDL_CreateProperties(3)SDL_CreateRenderer(3)SDL_CreateSoftwareRenderer(3)SDL_DestroyRenderer(3)SDL_GetRendererName(3)
Simple Directmedia Layer ยท SDL 3.4.18 ยท that's the whole page babes, go forth and create renderers ๐๐ฆ๐ธ๐ periodt โจ
๐ฆ 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