sdlOpenXrLoadLibrary function openxr

bool sdlOpenXrLoadLibrary()

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.

\returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function is not thread safe.

\since This function is available since SDL 3.6.0.

\sa SDL_HINT_OPENXR_LIBRARY

extern SDL_DECLSPEC bool SDLCALL SDL_OpenXR_LoadLibrary(void)

Implementation

bool sdlOpenXrLoadLibrary() {
  final sdlOpenXrLoadLibraryLookupFunction = _libSdl
      .lookupFunction<Uint8 Function(), int Function()>(
        'SDL_OpenXR_LoadLibrary',
      );
  return sdlOpenXrLoadLibraryLookupFunction() == 1;
}