Scroll to navigation

SDL_GetGPUXRSwapchainFormats(3) SDL3 FUNCTIONS SDL_GetGPUXRSwapchainFormats(3)

NAME

SDL_GetGPUXRSwapchainFormats - Queries the GPU device for supported XR swapchain image formats.

SYNOPSIS

#include <SDL3/SDL_openxr.h>
SDL_GPUTextureFormat * SDL_GetGPUXRSwapchainFormats(SDL_GPUDevice *device, XrSession session, int *num_formats);

DESCRIPTION

The returned pointer should be allocated with SDL_malloc() and will be passed to SDL_free().

FUNCTION PARAMETERS

a GPU context.
an OpenXR session created for the given device.
a pointer filled with the number of supported XR swapchain formats.

RETURN VALUE

Returns a 0 terminated array of supported formats or NULL on failure; call SDL_GetError() for more information. This should be freed with SDL_free() when it is no longer needed.

AVAILABILITY

This function is available since SDL 3.6.0.

SEE ALSO

SDL_CreateGPUXRSwapchain(3)

SDL 3.5.0 Simple Directmedia Layer