---
name: "SDL_GetWindowProperties"
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_GetWindowProperties"
---

# SDL\_GetWindowProperties(3)

Get the properties associated with a window.

## NAME

SDL\_GetWindowProperties - Get the properties associated with a window.

## HEADER FILE

Defined in SDL3/SDL\_video.h

## SYNOPSIS

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

**SDL\_PropertiesID SDL\_GetWindowProperties(SDL\_Window \*window);**

## DESCRIPTION

The following read-only properties are provided by SDL:

•  **SDL\_PROP\_WINDOW\_SHAPE\_POINTER** : the\
   surface associated with a shaped window

•  **SDL\_PROP\_WINDOW\_HDR\_ENABLED\_BOOLEAN** :\
   true if the window has HDR headroom above the SDR white point. This\
   property can change dynamically when

**SDL\_EVENT\_WINDOW\_HDR\_STATE\_CHANGED**

  is sent.

•  **SDL\_PROP\_WINDOW\_SDR\_WHITE\_LEVEL\_FLOAT** :\
   the value of SDR white in the

**SDL\_COLORSPACE\_SRGB\_LINEAR**\
  colorspace. On\
   Windows this corresponds to the SDR white level in scRGB colorspace, and\
   on Apple platforms this is always 1.0 for EDR content. This property can\
   change dynamically when

**SDL\_EVENT\_WINDOW\_HDR\_STATE\_CHANGED**

  is sent.

•  **SDL\_PROP\_WINDOW\_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 be 1.0. This property\
   can change dynamically when

**SDL\_EVENT\_WINDOW\_HDR\_STATE\_CHANGED**

  is sent.

On Android:

•  **SDL\_PROP\_WINDOW\_ANDROID\_WINDOW\_POINTER** :\
   the ANativeWindow associated with the window

•  **SDL\_PROP\_WINDOW\_ANDROID\_SURFACE\_POINTER** :\
   the EGLSurface associated with the window

On iOS:

•  **SDL\_PROP\_WINDOW\_UIKIT\_WINDOW\_POINTER** :\
   the **(\_\_unsafe\_unretained)** UIWindow associated with the window

•  **SDL\_PROP\_WINDOW\_UIKIT\_METAL\_VIEW\_TAG\_NUMBER** :\
   the NSInteger tag associated with metal views on the window

•  **SDL\_PROP\_WINDOW\_UIKIT\_OPENGL\_FRAMEBUFFER\_NUMBER** :\
   the OpenGL view's framebuffer object. It must be bound when rendering to\
   the screen using OpenGL.

•  **SDL\_PROP\_WINDOW\_UIKIT\_OPENGL\_RENDERBUFFER\_NUMBER** :\
   the OpenGL view's renderbuffer object. It must be bound when

**SDL\_GL\_SwapWindow**\
  is called.

•  **SDL\_PROP\_WINDOW\_UIKIT\_OPENGL\_RESOLVE\_FRAMEBUFFER\_NUMBER** :\
   the OpenGL view's resolve framebuffer, when MSAA is used.

On KMS/DRM:

•  **SDL\_PROP\_WINDOW\_KMSDRM\_DEVICE\_INDEX\_NUMBER** :\
   the device index associated with the window (e.g. the X in\
   /dev/dri/cardX)

•  **SDL\_PROP\_WINDOW\_KMSDRM\_DRM\_FD\_NUMBER** :\
   the DRM FD associated with the window

•  **SDL\_PROP\_WINDOW\_KMSDRM\_GBM\_DEVICE\_POINTER** :\
   the GBM device associated with the window

On macOS:

•  **SDL\_PROP\_WINDOW\_COCOA\_WINDOW\_POINTER** :\
   the **(\_\_unsafe\_unretained)** NSWindow associated with the window

•  **SDL\_PROP\_WINDOW\_COCOA\_METAL\_VIEW\_TAG\_NUMBER** :\
   the NSInteger tag assocated with metal views on the window

On OpenVR:

•  **SDL\_PROP\_WINDOW\_OPENVR\_OVERLAY\_ID** :\
   the OpenVR Overlay Handle ID for the associated overlay window.

On Vivante:

•  **SDL\_PROP\_WINDOW\_VIVANTE\_DISPLAY\_POINTER** :\
   the EGLNativeDisplayType associated with the window

•  **SDL\_PROP\_WINDOW\_VIVANTE\_WINDOW\_POINTER** :\
   the EGLNativeWindowType associated with the window

•  **SDL\_PROP\_WINDOW\_VIVANTE\_SURFACE\_POINTER** :\
   the EGLSurface associated with the window

On Windows:

•  **SDL\_PROP\_WINDOW\_WIN32\_HWND\_POINTER** :\
   the HWND associated with the window

•  **SDL\_PROP\_WINDOW\_WIN32\_HDC\_POINTER** :\
   the HDC associated with the window

•  **SDL\_PROP\_WINDOW\_WIN32\_INSTANCE\_POINTER** :\
   the HINSTANCE associated with the window

On Wayland:

Note: The **xdg\_\*** window objects do not internally persist across window show/hide calls. They will be null if the window is hidden and must be queried each time it is shown.

•  **SDL\_PROP\_WINDOW\_WAYLAND\_DISPLAY\_POINTER** :\
   the wl\_display associated with the window

•  **SDL\_PROP\_WINDOW\_WAYLAND\_SURFACE\_POINTER** :\
   the wl\_surface associated with the window

•  **SDL\_PROP\_WINDOW\_WAYLAND\_VIEWPORT\_POINTER** :\
   the wp\_viewport associated with the window

•  **SDL\_PROP\_WINDOW\_WAYLAND\_EGL\_WINDOW\_POINTER** :\
   the wl\_egl\_window associated with the window

•  **SDL\_PROP\_WINDOW\_WAYLAND\_XDG\_SURFACE\_POINTER** :\
   the xdg\_surface associated with the window

•  **SDL\_PROP\_WINDOW\_WAYLAND\_XDG\_TOPLEVEL\_POINTER** :\
   the xdg\_toplevel role associated with the window

• ' **SDL\_PROP\_WINDOW\_WAYLAND\_XDG\_TOPLEVEL\_EXPORT\_HANDLE\_STRING**\
   the export handle associated with the window

•  **SDL\_PROP\_WINDOW\_WAYLAND\_XDG\_POPUP\_POINTER** :\
   the xdg\_popup role associated with the window

•  **SDL\_PROP\_WINDOW\_WAYLAND\_XDG\_POSITIONER\_POINTER** :\
   the xdg\_positioner associated with the window, in popup mode

On X11:

•  **SDL\_PROP\_WINDOW\_X11\_DISPLAY\_POINTER** :\
   the X11 Display associated with the window

•  **SDL\_PROP\_WINDOW\_X11\_SCREEN\_NUMBER** :\
   the screen number associated with the window

•  **SDL\_PROP\_WINDOW\_X11\_WINDOW\_NUMBER** :\
   the X11 Window associated with the window

## FUNCTION PARAMETERS

- *window*

  the window to query.

## RETURN VALUE

( **SDL\_PropertiesID** ) Returns a valid property ID on success or 0 on failure; 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.
