---
name: "SDL_CreateRendererWithProperties"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_CreateRendererWithProperties"
---

# SDL\_CreateRendererWithProperties(3)

Create a 2D rendering context for a window, with the specified properties.

## NAME

SDL\_CreateRendererWithProperties - Create a 2D rendering context for a window, with the specified properties.

## HEADER FILE

Defined in SDL3/SDL\_render.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_Renderer \* SDL\_CreateRendererWithProperties(SDL\_PropertiesID props);**

## DESCRIPTION

These are the supported properties:

•  **SDL\_PROP\_RENDERER\_CREATE\_NAME\_STRING** :\
   the name of the rendering driver to use, if a specific one is desired

•  **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** :\
   an  **SDL\_Colorspace**\
  value describing the colorspace for\
   output to the display, defaults to

**SDL\_COLORSPACE\_SRGB** . The direct3d11, direct3d12,\
   and metal renderers support

**SDL\_COLORSPACE\_SRGB\_LINEAR** , which is a\
   linear color space and supports HDR output. If you select

**SDL\_COLORSPACE\_SRGB\_LINEAR** , drawing still\
   uses the sRGB colorspace, but values can go beyond 1.0 and float (linear)\
   format textures can be used for HDR content.

•  **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 by

**SDL\_SetRenderVSync** () for the renderer.

With the vulkan renderer:

•  **SDL\_PROP\_RENDERER\_CREATE\_VULKAN\_INSTANCE\_POINTER** :\
   the VkInstance to use with the renderer, optional.

•  **SDL\_PROP\_RENDERER\_CREATE\_VULKAN\_SURFACE\_NUMBER** :\
   the VkSurfaceKHR to use with the renderer, optional.

•  **SDL\_PROP\_RENDERER\_CREATE\_VULKAN\_PHYSICAL\_DEVICE\_POINTER** :\
   the VkPhysicalDevice to use with the renderer, optional.

•  **SDL\_PROP\_RENDERER\_CREATE\_VULKAN\_DEVICE\_POINTER** :\
   the VkDevice to 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

( **SDL\_Renderer**\
  \*) Returns a valid rendering context or NULL if there was an error; call  **SDL\_GetError** () for more information.

## THREAD SAFETY

This function should only be called on the main thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_CreateProperties**(3)](/SDL_CreateProperties/3.md), **•**(3), [**SDL\_CreateRenderer**(3)](/SDL_CreateRenderer/3.md), **•**(3), [**SDL\_CreateSoftwareRenderer**(3)](/SDL_CreateSoftwareRenderer/3.md), **•**(3), [**SDL\_DestroyRenderer**(3)](/SDL_DestroyRenderer/3.md), **•**(3), [**SDL\_GetRendererName**(3)](/SDL_GetRendererName/3.md)
