Class XrDriver
java.lang.Object
gaiasky.vr.openxr.XrDriver
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Handles initialization and lifecycle of OpenXR. Only active when Gaia Sky is run in VR mode.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionlongbooleanlonglongorg.lwjgl.openxr.XrViewConfigurationView.Bufferfinal intorg.lwjgl.openxr.XrView.Bufferorg.lwjgl.openxr.XrSpaceorg.lwjgl.openxr.XrDebugUtilsMessengerEXTorg.lwjgl.openxr.XrInstanceorg.lwjgl.openxr.XrSession -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(XrInputListener listener) Adds aXrInputListenerto receive eventsvoidcheck(int result) voidvoidcheckNoException(int result) voidcheckNoException(int result, String method) voidvoidCreates the OpenXR instance object.voidCreates an XrSpace from the previously created session.voidInitializes the XR swapchains.voiddispose()voidvoidcom.badlogic.gdx.utils.Array<XrControllerDevice> intbooleanlongintgetWidth()org.lwjgl.openxr.XrGraphicsRequirementsOpenGLKHRgetXrGraphicsRequirements(org.lwjgl.system.MemoryStack stack) booleanvoidvoidvoidinitializeOpenXRSession(long windowHandle) Creates the XrSession object.voidCreates the system with which to later create a session.booleanbooleanPolls pending events in the OpenXR system.voidremoveListener(XrInputListener listener) Removes aXrInputListenervoidRenders the next frame with the current renderer.voidsetRenderer(XrRenderer renderer)
-
Field Details
-
systemId
public long systemId -
missingXrDebug
public boolean missingXrDebug -
runtimeName
-
runtimeVersionString
-
hmdName
-
systemString
-
runtimeVersion
public long runtimeVersion -
xrInstance
public org.lwjgl.openxr.XrInstance xrInstance -
xrSession
public org.lwjgl.openxr.XrSession xrSession -
xrDebugMessenger
public org.lwjgl.openxr.XrDebugUtilsMessengerEXT xrDebugMessenger -
xrAppSpace
public org.lwjgl.openxr.XrSpace xrAppSpace -
views
public org.lwjgl.openxr.XrView.Buffer views -
swapChains
-
viewConfigs
public org.lwjgl.openxr.XrViewConfigurationView.Buffer viewConfigs -
viewConfigType
public final int viewConfigType- See Also:
-
currentFrameTime
public long currentFrameTime
-
-
Constructor Details
-
XrDriver
public XrDriver()
-
-
Method Details
-
createOpenXRInstance
public void createOpenXRInstance()Creates the OpenXR instance object. First method to call in the OpenXR initialization sequence. -
initializeXRSystem
public void initializeXRSystem()Creates the system with which to later create a session. Second method to call in the OpenXR initialization sequence. -
getXrGraphicsRequirements
public org.lwjgl.openxr.XrGraphicsRequirementsOpenGLKHR getXrGraphicsRequirements(org.lwjgl.system.MemoryStack stack) -
checkOpenGL
public void checkOpenGL() -
initializeOpenXRSession
public void initializeOpenXRSession(long windowHandle) Creates the XrSession object. Third method to call in the OpenXR initialization sequence. -
createOpenXRReferenceSpace
public void createOpenXRReferenceSpace()Creates an XrSpace from the previously created session. Fourth method to call in the OpenXR initialization sequence. -
createOpenXRSwapchains
public void createOpenXRSwapchains()Initializes the XR swapchains. Fifth method to call in the OpenXR initialization sequence. -
initializeOpenGLFrameBuffers
public void initializeOpenGLFrameBuffers() -
initializeInput
public void initializeInput() -
renderFrameOpenXR
public void renderFrameOpenXR()Renders the next frame with the current renderer. -
getPath
-
getLastPollEventsResult
public boolean getLastPollEventsResult() -
pollEvents
public boolean pollEvents()Polls pending events in the OpenXR system.- Returns:
- True if we must stop, false otherwise.
-
disposeOld
public void disposeOld() -
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
disposeInput
public void disposeInput() -
check
- Throws:
IllegalStateException
-
check
-
checkNoException
public void checkNoException(int result) -
checkNoException
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getControllerDevices
-
addListener
Adds aXrInputListenerto receive events -
removeListener
Removes aXrInputListener -
setRenderer
-
hasRenderer
public boolean hasRenderer() -
isRunning
public boolean isRunning()
-