Get the properties associated with a window.
Defined in <SDL3/SDL_video.h>
window | the window to query |
Returns a valid property ID on success or 0 on failure; call SDL_GetError() for more information.
The following read-only properties are provided by SDL:
SDL_PROP_WINDOW_SHAPE_POINTER
: the surface associated with a shaped windowOn Android:
SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER
: the ANativeWindow associated with the windowSDL_PROP_WINDOW_ANDROID_SURFACE_POINTER
: the EGLSurface associated with the windowOn iOS:
SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER
: the (__unsafe_unretained)
UIWindow associated with the windowSDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER
: the NSInteger tag assocated with metal views on the windowOn 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 windowSDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER
: the GBM device associated with the windowOn macOS:
SDL_PROP_WINDOW_COCOA_WINDOW_POINTER
: the (__unsafe_unretained)
NSWindow associated with the windowSDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER
: the NSInteger tag assocated with metal views on the windowOn Vivante:
SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER
: the EGLNativeDisplayType associated with the windowSDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER
: the EGLNativeWindowType associated with the windowSDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER
: the EGLSurface associated with the windowOn UWP:
SDL_PROP_WINDOW_WINRT_WINDOW_POINTER
: the IInspectable CoreWindow associated with the windowOn Windows:
SDL_PROP_WINDOW_WIN32_HWND_POINTER
: the HWND associated with the windowSDL_PROP_WINDOW_WIN32_HDC_POINTER
: the HDC associated with the windowSDL_PROP_WINDOW_WIN32_INSTANCE_POINTER
: the HINSTANCE associated with the windowOn 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 windowSDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER
: the wl_surface associated with the windowSDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER
: the wl_egl_window associated with the windowSDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER
: the xdg_surface associated with the windowSDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER
: the xdg_toplevel role associated with the windowSDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER
: the xdg_popup role associated with the windowSDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER
: the xdg_positioner associated with the window, in popup modeOn X11:
SDL_PROP_WINDOW_X11_DISPLAY_POINTER
: the X11 Display associated with the windowSDL_PROP_WINDOW_X11_SCREEN_NUMBER
: the screen number associated with the windowSDL_PROP_WINDOW_X11_WINDOW_NUMBER
: the X11 Window associated with the windowThis function is available since SDL 3.0.0.