Class KHROpenGLEnable

java.lang.Object
org.lwjgl.openxr.KHROpenGLEnable

public class KHROpenGLEnable extends Object
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.