Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class KHROpenGLEnable

extends Object
Class Inheritance
Imports
org.lwjgl.system.*

The XR_KHR_opengl_enable extension.

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

Modifier and TypeField and Description
public static final String
public static final int
XR_KHR_opengl_enable_SPEC_VERSION

The extension specification version.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR

Extends XrStructureType.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nxrGetOpenGLGraphicsRequirementsKHR(XrInstance instance, long systemId, long graphicsRequirements)

Unsafe version of: GetOpenGLGraphicsRequirementsKHR

public static int
xrGetOpenGLGraphicsRequirementsKHR(XrInstance
an XrInstance handle previously created with CreateInstance.
instance
,
long
an XrSystemId handle for the system which will be used to create a session.
systemId
,
XrGraphicsRequirementsOpenGLKHR
the XrGraphicsRequirementsOpenGLKHR output structure.
graphicsRequirements
)

Retrieve the OpenGL version requirements for an instance and system.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_KHR_OPENGL_ENABLE_EXTENSION_NAMEback to summary
public static final String XR_KHR_OPENGL_ENABLE_EXTENSION_NAME

The extension name.

XR_KHR_opengl_enable_SPEC_VERSIONback to summary
public static final int XR_KHR_opengl_enable_SPEC_VERSION

The extension specification version.

XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHRback to summary
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR

Extends XrStructureType.

Enum values:
XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHRback to summary
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_WIN32_KHR

Extends XrStructureType.

Enum values:
XR_TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHRback to summary
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_XCB_KHR

Extends XrStructureType.

Enum values:
XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHRback to summary
public static final int XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR

Extends XrStructureType.

Enum values:
XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHRback to summary
public static final int XR_TYPE_GRAPHICS_REQUIREMENTS_OPENGL_KHR

Extends XrStructureType.

Enum values:
XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHRback to summary
public static final int XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR

Extends XrStructureType.

Enum values:

Constructor Detail

KHROpenGLEnableback to summary
protected KHROpenGLEnable()

Method Detail

nxrGetOpenGLGraphicsRequirementsKHRback to summary
public static int nxrGetOpenGLGraphicsRequirementsKHR(XrInstance instance, long systemId, long graphicsRequirements)

Unsafe version of: GetOpenGLGraphicsRequirementsKHR

xrGetOpenGLGraphicsRequirementsKHRback to summary
public static int xrGetOpenGLGraphicsRequirementsKHR(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 GetOpenGLGraphicsRequirementsKHR function identifies to the application the minimum OpenGL version requirement and the highest known tested OpenGL version. The runtime must return ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING (ERROR_VALIDATION_FAILURE may be returned due to legacy behavior) on calls to CreateSession if GetOpenGLGraphicsRequirementsKHR has not been called for the same instance and systemId.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrGraphicsRequirementsOpenGLKHR

Parameters
instance:XrInstance

an XrInstance handle previously created with CreateInstance.

systemId:long

an XrSystemId handle for the system which will be used to create a session.

graphicsRequirements:XrGraphicsRequirementsOpenGLKHR

the XrGraphicsRequirementsOpenGLKHR output structure.

Annotations
@NativeType:XrResult