|
SDL 3.0
|
#include <SDL3/SDL_stdinc.h>#include <SDL3/SDL_gpu.h>#include <SDL3/SDL_begin_code.h>#include <SDL3/SDL_close_code.h>Go to the source code of this file.
Data Structures | |
| struct | XrSessionCreateInfo |
| struct | XrSwapchainCreateInfo |
Macros | |
| #define | XR_NULL_HANDLE 0 |
| #define | XR_DEFINE_HANDLE(object) |
| #define | PFN_xrGetInstanceProcAddr SDL_FunctionPointer |
Enumerations | |
| enum | XrStructureType { XR_TYPE_SESSION_CREATE_INFO = 8 , XR_TYPE_SWAPCHAIN_CREATE_INFO = 9 } |
| enum | XrResult { XR_ERROR_FUNCTION_UNSUPPORTED = -7 , XR_ERROR_HANDLE_INVALID = -12 } |
Functions | |
| XrResult | SDL_CreateGPUXRSession (SDL_GPUDevice *device, const XrSessionCreateInfo *createinfo, XrSession *session) |
| SDL_GPUTextureFormat * | SDL_GetGPUXRSwapchainFormats (SDL_GPUDevice *device, XrSession session, int *num_formats) |
| XrResult | SDL_CreateGPUXRSwapchain (SDL_GPUDevice *device, XrSession session, const XrSwapchainCreateInfo *createinfo, SDL_GPUTextureFormat format, XrSwapchain *swapchain, SDL_GPUTexture ***textures) |
| XrResult | SDL_DestroyGPUXRSwapchain (SDL_GPUDevice *device, XrSwapchain swapchain, SDL_GPUTexture **swapchainImages) |
| bool | SDL_OpenXR_LoadLibrary (void) |
| void | SDL_OpenXR_UnloadLibrary (void) |
| PFN_xrGetInstanceProcAddr | SDL_OpenXR_GetXrGetInstanceProcAddr (void) |
| #define PFN_xrGetInstanceProcAddr SDL_FunctionPointer |
Definition at line 79 of file SDL_openxr.h.
Referenced by SDL_OpenXR_GetXrGetInstanceProcAddr().
| #define XR_DEFINE_HANDLE | ( | object | ) |
Definition at line 52 of file SDL_openxr.h.
| #define XR_NULL_HANDLE 0 |
Functions for creating OpenXR handles for SDL_gpu contexts.
For the most part, OpenXR operates independent of SDL, but the graphics initialization depends on direct support from SDL_gpu.
Definition at line 49 of file SDL_openxr.h.
| enum XrResult |
| Enumerator | |
|---|---|
| XR_ERROR_FUNCTION_UNSUPPORTED | |
| XR_ERROR_HANDLE_INVALID | |
Definition at line 74 of file SDL_openxr.h.
| enum XrStructureType |
| Enumerator | |
|---|---|
| XR_TYPE_SESSION_CREATE_INFO | |
| XR_TYPE_SWAPCHAIN_CREATE_INFO | |
Definition at line 55 of file SDL_openxr.h.
|
extern |
Creates an OpenXR session.
The OpenXR system ID is pulled from the passed GPU context.
| device | a GPU context. |
| createinfo | the create info for the OpenXR session, sans the system ID. |
| session | a pointer filled in with an OpenXR session created for the given device. |
|
extern |
Creates an OpenXR swapchain.
The array returned via textures is sized according to xrEnumerateSwapchainImages, and thus should only be accessed via index values returned from xrAcquireSwapchainImage.
Applications are still allowed to call xrEnumerateSwapchainImages on the returned XrSwapchain if they need to get the exact size of the array.
| device | a GPU context. |
| session | an OpenXR session created for the given device. |
| createinfo | the create info for the OpenXR swapchain, sans the format. |
| format | a supported format for the OpenXR swapchain. |
| swapchain | a pointer filled in with the created OpenXR swapchain. |
| textures | a pointer filled in with the array of created swapchain images. |
|
extern |
Destroys and OpenXR swapchain previously returned by SDL_CreateGPUXRSwapchain.
| device | a GPU context. |
| swapchain | a swapchain previously returned by SDL_CreateGPUXRSwapchain. |
| swapchainImages | an array of swapchain images returned by the same call to SDL_CreateGPUXRSwapchain. |
|
extern |
Queries the GPU device for supported XR swapchain image formats.
The returned pointer should be allocated with SDL_malloc() and will be passed to SDL_free().
| device | a GPU context. |
| session | an OpenXR session created for the given device. |
| num_formats | a pointer filled with the number of supported XR swapchain formats. |
|
extern |
Get the address of the xrGetInstanceProcAddr function.
This should be called after either calling SDL_OpenXR_LoadLibrary() or creating an OpenXR SDL_GPUDevice.
The actual type of the returned function pointer is PFN_xrGetInstanceProcAddr, but that isn't always available. You should include the OpenXR headers before this header, or cast the return value of this function to the correct type.
References PFN_xrGetInstanceProcAddr.
|
extern |
Dynamically load the OpenXR loader.
This can be called at any time.
SDL keeps a reference count of the OpenXR loader, calling this function multiple times will increment that count, rather than loading the library multiple times.
If not called, this will be implicitly called when creating a GPU device with OpenXR.
This function will use the platform default OpenXR loader name, unless the SDL_HINT_OPENXR_LIBRARY hint is set.
\threadsafety This function is not thread safe.
|
extern |
Unload the OpenXR loader previously loaded by SDL_OpenXR_LoadLibrary.
SDL keeps a reference count of the OpenXR loader, calling this function will decrement that count. Once the reference count reaches zero, the library is unloaded.
\threadsafety This function is not thread safe.