Class KHROpenGLEnable
This extension enables the use of the OpenGL graphics API in an OpenXR runtime. Without this extension, the OpenXR runtime may not be able to provide any OpenGL swapchain images.
This extension provides the mechanisms necessary for an application to generate a valid stext:XrGraphicsBindingOpenGL*KHR structure in order to create an OpenGL-based XrSession. Note that during this process the application is responsible for creating an OpenGL context to be used for rendering. The runtime however will provide the OpenGL textures to render into in the form of a swapchain.
This extension provides mechanisms for the application to interact with images acquired by calling EnumerateSwapchainImages.
In order to expose the structures, types, and functions of this extension, the application must define USE_GRAPHICS_API_OPENGL, as well as an appropriate window system define supported by this extension, before including the OpenXR platform header openxr_platform.h, in all portions of the library or application that include it. The window system defines currently supported by this extension are:
Note that a runtime implementation of this extension is only required to support the structs introduced by this extension which belong to the platform it is running on.
Note that the OpenGL context given to the call CreateSession must not be bound in another thread when calling the functions: CreateSession, DestroySession, BeginFrame, EndFrame, CreateSwapchain, DestroySwapchain, EnumerateSwapchainImages, AcquireSwapchainImage, WaitSwapchainImage and ReleaseSwapchainImage. It may be bound in the thread calling those functions. The runtime must not access the context from any other function. In particular the application must be able to call WaitFrame from a different thread than the rendering thread.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrGetOpenGLGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, long graphicsRequirements) Unsafe version of:GetOpenGLGraphicsRequirementsKHRstatic intxrGetOpenGLGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, XrGraphicsRequirementsOpenGLKHR graphicsRequirements) Retrieve the OpenGL version requirements for an instance and system.
-
Field Details
-
XR_KHR_opengl_enable_SPEC_VERSION
public static final int XR_KHR_opengl_enable_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_KHR_OPENGL_ENABLE_EXTENSION_NAME
The extension name.- See Also:
-
XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHRExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHRExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHRExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHRExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR
public static final int XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHRExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR
public static final int XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHRExtendsXrStructureType.Enum values:
- See Also:
-
-
Method Details
-
nxrGetOpenGLGraphicsRequirementsKHR
public static int nxrGetOpenGLGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, long graphicsRequirements) Unsafe version of:GetOpenGLGraphicsRequirementsKHR -
xrGetOpenGLGraphicsRequirementsKHR
public static int xrGetOpenGLGraphicsRequirementsKHR(org.lwjgl.openxr.XrInstance instance, long systemId, XrGraphicsRequirementsOpenGLKHR graphicsRequirements) Retrieve the OpenGL version requirements for an instance and system.C Specification
To query OpenGL API version requirements for an instance and system, call:
XrResult xrGetOpenGLGraphicsRequirementsKHR( XrInstance instance, XrSystemId systemId, XrGraphicsRequirementsOpenGLKHR* graphicsRequirements);Description
The
GetOpenGLGraphicsRequirementsKHRfunction identifies to the application the minimum OpenGL version requirement and the highest known tested OpenGL version. The runtime must returnERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING(ERROR_VALIDATION_FAILUREmay be returned due to legacy behavior) on calls toCreateSessionifGetOpenGLGraphicsRequirementsKHRhas not been called for the sameinstanceandsystemId.Valid Usage (Implicit)
- The
XR_KHR_opengl_enableextension must be enabled prior to callingGetOpenGLGraphicsRequirementsKHR instancemust be a validXrInstancehandlegraphicsRequirementsmust be a pointer to anXrGraphicsRequirementsOpenGLKHRstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
instance- anXrInstancehandle previously created withCreateInstance.systemId- anXrSystemIdhandle for the system which will be used to create a session.graphicsRequirements- theXrGraphicsRequirementsOpenGLKHRoutput structure.
- The
-