xr.ext package
Submodules
xr.ext.KHR.opengl_enable module
Module xr.ext.KHR.opengl_enable — Python bindings for the XR_KHR_opengl_enable extension.
This module provides access to OpenGL-specific graphics requirements via OpenXR. It exposes a Pythonic wrapper around xrGetOpenGLGraphicsRequirementsKHR, allowing applications to query the minimum and maximum supported OpenGL versions for a given system.
To use this extension, ensure “XR_KHR_opengl_enable” is included in the list of enabled extensions during instance creation.
- xr.ext.KHR.opengl_enable.get_opengl_graphics_requirements(instance: Instance, system_id: c_ulonglong) GraphicsRequirementsOpenGLKHR
Query the OpenGL graphics requirements for a given system.
This function wraps xrGetOpenGLGraphicsRequirementsKHR, returning the minimum and maximum OpenGL versions supported by the runtime for the specified system. It is typically called before creating a graphics context to ensure compatibility.
- Parameters:
instance (xr.Instance) – The OpenXR instance with the XR_KHR_opengl_enable extension enabled.
system_id (xr.SystemId) – The system identifier obtained via xr.get_system().
- Returns:
A structure containing the OpenGL graphics requirements.
- Return type:
- Raises:
xr.FunctionUnsupportedError – If the extension function is unavailable.
xr.HandleInvalidError – If the instance handle is invalid.
xr.SystemInvalidError – If the system ID is not recognized.
xr.InstanceLossPendingError – If the instance is in a loss-pending state.
- Seealso: