15 #define SXR_MAJOR_VERSION 3 16 #define SXR_MINOR_VERSION 0 17 #define SXR_REVISION_VERSION 2 19 #define SXR_MAX_RENDER_LAYERS 16 27 SXR_ERROR_UNKNOWN = 1,
31 SXR_ERROR_UNSUPPORTED,
34 SXR_ERROR_VRMODE_NOT_INITIALIZED,
37 SXR_ERROR_VRMODE_NOT_STARTED,
40 SXR_ERROR_VRMODE_NOT_STOPPED,
43 SXR_ERROR_QVR_SERVICE_UNAVAILABLE,
53 kEventSdkServiceStarting = 1,
54 kEventSdkServiceStarted = 2,
55 kEventSdkServiceStopped = 3,
56 kEventControllerConnecting = 4,
57 kEventControllerConnected = 5,
58 kEventControllerDisconnected = 6,
60 kEventVrModeStarted = 8,
61 kEventVrModeStopping = 9,
62 kEventVrModeStopped = 10,
63 kEventSensorError = 11,
64 kEventMagnometerUncalibrated = 12,
65 kEventBoundarySystemCollision = 13,
66 kEvent6dofRelocation = 14,
67 kEvent6dofWarningFeatureCount = 15,
68 kEvent6dofWarningLowLight = 16,
69 kEvent6dofWarningBrightLight = 17,
70 kEvent6dofWarningCameraCalibration = 18
116 kEyeMaskLeft = 0x00000001,
117 kEyeMaskRight = 0x00000002,
118 kEyeMaskBoth = 0x00000003
124 kLayerFlagNone = 0x00000000,
125 kLayerFlagHeadLocked = 0x00000001,
126 kLayerFlagOpaque = 0x00000002
131 kColorSpaceLinear = 0,
146 kTrackingRotation = (1 << 0),
147 kTrackingPosition = (1 << 1),
148 kTrackingEye = (1 << 2)
164 kGazePointValid = (1 << 0),
165 kGazeVectorValid = (1 << 1),
166 kEyeOpennessValid = (1 << 2),
167 kEyePupilDilationValid = (1 << 3),
168 kEyePositionGuideValid = (1 << 4)
180 float leftEyeGazePoint[3];
181 float rightEyeGazePoint[3];
182 float combinedEyeGazePoint[3];
184 float leftEyeGazeVector[3];
185 float rightEyeGazeVector[3];
186 float combinedEyeGazeVector[3];
194 float leftEyePositionGuide[3];
195 float rightEyePositionGuide[3];
212 kProtectedContent = (1 << 0),
213 kMotionAwareFrames = (1 << 1)
259 uint32_t bytesPerPixel;
260 uint32_t renderSemaphore;
274 kMeshTypeColumsLtoR = 0,
297 float LowerLeftPos[4];
298 float LowerRightPos[4];
299 float UpperLeftPos[4];
300 float UpperRightPos[4];
305 float TransformMatrix[16];
387 float trackingCalibration[12];
388 float trackingPrincipalPoint[2];
389 float trackingFocalLength[2];
390 float trackingRadialDist[8];
434 kControllerMessageRecenter = 0,
435 kControllerMessageVibration = 1
441 kControllerQueryBatteryRemaining = 0,
442 kControllerQueryControllerCaps = 1
462 PrimaryThumbstick = 0x00000010,
463 SecondaryThumstick = 0x00000020,
471 PrimaryIndexTrigger = 0x00000000,
472 SecondaryIndexTrigger = 0x00000001,
473 PrimaryHandTrigger = 0x00000002,
474 SecondaryHandTrigger = 0x00000003
481 PrimaryThumbstick = 0x00000000,
482 SecondaryThumbstick = 0x00000001
495 DpadDown = 0x00000020,
496 DpadLeft = 0x00000040,
497 DpadRight = 0x00000080,
500 PrimaryShoulder = 0x00001000,
501 PrimaryIndexTrigger = 0x00002000,
502 PrimaryHandTrigger = 0x00004000,
503 PrimaryThumbstick = 0x00008000,
504 PrimaryThumbstickUp = 0x00010000,
505 PrimaryThumbstickDown = 0x00020000,
506 PrimaryThumbstickLeft = 0x00040000,
507 PrimaryThumbstickRight = 0x00080000,
508 SecondaryShoulder = 0x00100000,
509 SecondaryIndexTrigger = 0x00200000,
510 SecondaryHandTrigger = 0x00400000,
511 SecondaryThumbstick = 0x00800000,
512 SecondaryThumbstickUp = 0x01000000,
513 SecondaryThumbstickDown = 0x02000000,
514 SecondaryThumbstickLeft = 0x04000000,
515 SecondaryThumbstickRight = 0x08000000,
560 char deviceManufacturer[64];
563 char deviceIdentifier[64];
708 SXRP_EXPORT
int sxrControllerQuery(
int controllerHandle,
int what,
void* memory,
unsigned int memorySize);
719 SXRP_EXPORT SxrResult
sxrSetWarpMesh(
sxrWarpMeshEnum whichMesh,
void *pVertexData,
int vertexSize,
int nVertices,
unsigned int* pIndices,
int nIndices);
SXRP_EXPORT void sxrEnableBoundarySystem(bool enableBoundary=true)
Enable/Disable the Boundary system.
SXRP_EXPORT SxrResult sxrInitialize(const sxrInitParams *pInitParams)
Initializes VR components.
SXRP_EXPORT SxrResult sxrSetWarpMesh(sxrWarpMeshEnum whichMesh, void *pVertexData, int vertexSize, int nVertices, unsigned int *pIndices, int nIndices)
Replaces the current Time Warp mesh the supplied mesh.
float targetEyePitch
Recommended eye pitch.
Definition: sxrApi.h:379
SXRP_EXPORT SxrResult sxrSetBoundaryParameters(float *pMinValues, float *pMaxValues, float visibilityRadius)
Set parameters for the Boundary system.
int32_t displayOrientation
Display orientation (degrees at initialization - 0,90,180,270)
Definition: sxrApi.h:371
SXRP_EXPORT void sxrControllerStopTracking(int controllerHandle)
Stops tracking the controller.
Structure containing the eye tracking data.
Definition: sxrApi.h:172
sxrLayoutCoords imageCoords
Layout of this layer on the screen.
Definition: sxrApi.h:314
Disables the lens chromatic aberration correction (performance optimization)
Definition: sxrApi.h:235
Medium performance level.
Definition: sxrApi.h:204
SXRP_EXPORT const char * sxrGetVersion()
Returns the VR SDK version string.
sxrViewFrustum rightEyeFrustum
Recommended Frustum information for right eye.
Definition: sxrApi.h:377
sxrVector3 gyroscope
Gyro.
Definition: sxrApi.h:533
sxrEyeMask
Enum used to indicate which eye to apply a render layer.
Definition: sxrApi.h:114
SXRP_EXPORT int sxrControllerStartTracking(const char *controllerDesc)
Starts Tracking.
float left
Left Plane of Frustum.
Definition: sxrApi.h:349
int32_t targetEyeWidthPixels
Recommended eye buffer width (pixels)
Definition: sxrApi.h:372
sxrPerfLevel gpuPerfLevel
Desired GPU performance level.
Definition: sxrApi.h:222
Enables motion to photon testing.
Definition: sxrApi.h:234
sxrFoveation lowFoveation
Low foveation values.
Definition: sxrApi.h:382
int32_t frameIndex
Frame Index.
Definition: sxrApi.h:325
SXRP_EXPORT SxrResult sxrRecenterPosition()
Recenters the head position at the current position.
SXRP_EXPORT SxrResult sxrGetOcclusionMesh(sxrWhichEye whichEye, int *pTriangleCount, int *pVertexStride, float *pTriangles)
Gets triangle data for the occlusion area mesh.
sxrHeadPoseState headPoseState
Head pose state used to generate the frame.
Definition: sxrApi.h:331
float top
Top Plane of Frustum.
Definition: sxrApi.h:351
sxrWarpMeshType warpMeshType
Type of mesh used to render eye buffer.
Definition: sxrApi.h:381
float minimum
Foveation Minimum Resolution [1, 1/2, 1/4, ..., 1/16, 0].
Definition: sxrApi.h:362
sxrControllerMessageType
Events to use in sxrControllerSendMessage.
Definition: sxrApi.h:432
Standard texture array (Left eye is first layer, right eye is second layer)
Definition: sxrApi.h:243
uint32_t activeButtons
Enabled Buttons Bitfield.
Definition: sxrApi.h:569
sxrFoveation medFoveation
Medium foveation values.
Definition: sxrApi.h:383
float area
Foveation Area Size [0, ...].
Definition: sxrApi.h:361
SXRP_EXPORT sxrHeadPoseState sxrGetPredictedHeadPose(float predictedTimeMs)
Calculates a predicted head pose.
SXRP_EXPORT SxrResult sxrEndXr()
Disables XR services.
uint32_t caps
Controller Capabilities.
Definition: sxrApi.h:566
uint64_t poseTimeStampNs
Time stamp in which the head pose was generated (nanoseconds)
Definition: sxrApi.h:156
Simple structure to hold 4-component vector data.
Definition: sxrApi.h:88
System defined performance level (default)
Definition: sxrApi.h:202
Structure containing the position and orientation of the head.
Definition: sxrApi.h:137
sxrPerfLevel cpuPerfLevel
Desired CPU performance level.
Definition: sxrApi.h:221
SXRP_EXPORT SxrResult sxrGetXrServiceVersion(char *pRetBuffer, int bufferSize)
Returns the VR service version string.
uint64_t timestamp
timestamp
Definition: sxrApi.h:539
SXRP_EXPORT void sxrControllerSendMessage(int controllerHandle, int what, int arg1, int arg2)
Send a message to the controller.
Simple structure to hold 2-component vector data.
Definition: sxrApi.h:76
View Frustum. These values are based on physical device properties, except the far plane is arbitrary...
Definition: sxrApi.h:347
SXRP_EXPORT SxrResult sxrSetTrackingMode(uint32_t trackingModes)
Sets the current head tracking mode.
EGL Image texture.
Definition: sxrApi.h:244
sxrQuaternion rotation
Orientation.
Definition: sxrApi.h:527
sxrColorSpace colorSpace
Color space to utilize for the display surface.
Definition: sxrApi.h:225
sxrWhichEye
Enum used to indicate which eye is being used.
Definition: sxrApi.h:106
float rightEyePupilDilation
Right eye value in millimeters indicating the pupil dilation.
Definition: sxrApi.h:192
float targetEyeConvergence
Recommended eye convergence.
Definition: sxrApi.h:378
sxrFrameOption
Options which can be set when submitting a frame to modify the behavior of asynchronous time warp...
Definition: sxrApi.h:230
uint64_t expectedDisplayTimeNs
Expected time when this pose should be on screen (nanoseconds)
Definition: sxrApi.h:158
float near
Near Plane of Frustum.
Definition: sxrApi.h:354
int32_t imageHandle
Handle to the texture/image to be rendered.
Definition: sxrApi.h:312
SXRP_EXPORT SxrResult sxrBeginEye(sxrWhichEye whichEye, sxrTextureType imageType=kTypeTexture)
Called after eye buffer is bound but before game rendering starts.
sxrTextureType imageType
Type of texture: Standard Texture or EGL Image.
Definition: sxrApi.h:313
uint32_t active2DAnalogs
Active 2D Analogs Bitfield.
Definition: sxrApi.h:572
uint32_t frameOptions
Options for adjusting the frame warp behavior (bitfield of sxrFrameOption)
Definition: sxrApi.h:330
Simple structure to hold 4x4 matrix data.
Definition: sxrApi.h:100
Equirectangular Image texture.
Definition: sxrApi.h:246
sxrControllerQueryType
Query Values.
Definition: sxrApi.h:439
float fieldOfView
Field of view used to generate this frame (larger than device fov to provide timewarp margin) ...
Definition: sxrApi.h:333
sxrVulkanTexInfo vulkanInfo
Information about the data if it is a Vulkan texture.
Definition: sxrApi.h:317
Maximum performance level.
Definition: sxrApi.h:205
SXRP_EXPORT sxrDeviceInfo sxrGetDeviceInfo()
Queries for device specific information.
sxrControllerConnectionState
Controller Connection state.
Definition: sxrApi.h:446
SXRP_EXPORT SxrResult sxrSetPerformanceLevels(sxrPerfLevel cpuPerfLevel, sxrPerfLevel gpuPerfLevel)
Requests specific brackets of CPU/GPU performance.
SXRP_EXPORT bool sxrPollEvent(sxrEvent *pEvent)
Polls for an available event. If event(s) are present pEvent will be filled with the event details...
Structure containing the full set of pose data.
Definition: sxrApi.h:152
Disables re-projection.
Definition: sxrApi.h:233
int32_t displayWidthPixels
Physical width of the display (pixels)
Definition: sxrApi.h:368
SXRP_EXPORT float sxrGetPredictedDisplayTime()
Calculates a predicted time when the current frame would be displayed. Assumes a pipeline depth of 1...
sxrEventType
Events.
Definition: sxrApi.h:50
int32_t mainThreadId
Thread Id of the primary render thread.
Definition: sxrApi.h:220
sxrThermalLevel level
Indication of the current zone thermal level.
Definition: sxrApi.h:414
Disables the lens distortion correction (useful for debugging)
Definition: sxrApi.h:232
float bottom
Bottom Plane of Frustum.
Definition: sxrApi.h:352
SXRP_EXPORT SxrResult sxrBeginXr(const sxrBeginParams *pBeginParams)
Enables XR services.
Simple structure to hold 3-component vector data.
Definition: sxrApi.h:82
SXRP_EXPORT sxrControllerState sxrControllerGetState(int controllerHandle, int controllerSpace=0)
Get the current state of the controller.
float eventTimeStamp
Time stamp for the event in seconds since the last sxrBeginVr call.
Definition: sxrApi.h:427
sxrVector3 position
Position.
Definition: sxrApi.h:530
int32_t optionFlags
Flags to specify SXR options (sxrOptionFlags)
Definition: sxrApi.h:224
uint32_t activeTouchButtons
Active Touch Buttons.
Definition: sxrApi.h:578
Controller Trigger enumerations.
Definition: sxrApi.h:469
int32_t deviceOSVersion
Android OS Version of the device.
Definition: sxrApi.h:380
sxrPerfLevel
Enum used for indicating the CPU/GPU performance levels.
Definition: sxrApi.h:200
SXRP_EXPORT SxrResult sxrGetXrClientVersion(char *pRetBuffer, int bufferSize)
Returns the VR client version string.
float leftEyePupilDilation
Left eye value in millimeters indicating the pupil dilation.
Definition: sxrApi.h:191
int32_t displayHeightPixels
Physical height of the display (pixels)
Definition: sxrApi.h:369
Standard texture.
Definition: sxrApi.h:242
float targetFovXRad
Recommended horizontal FOV.
Definition: sxrApi.h:374
int32_t rightEyePoseStatus
Bit field (sxrEyePoseStatus) indicating right eye pose status.
Definition: sxrApi.h:177
float displayRefreshRateHz
Refresh rate of the display.
Definition: sxrApi.h:370
SXRP_EXPORT uint32_t sxrGetSupportedTrackingModes()
Returns the supported tracking types.
sxrOptionFlags
Flags used to set SXR options.
Definition: sxrApi.h:210
sxrWarpMeshEnum
Enumeration of possible warp meshes.
Definition: sxrApi.h:282
JavaVM * javaVm
Java Virtual Machine pointer.
Definition: sxrApi.h:340
Controller Joystick enumerations.
Definition: sxrApi.h:479
sxrEyeMask eyeMask
Determines which eye[s] receive this render layer.
Definition: sxrApi.h:315
float far
Far Plane of Frustum (Arbitrary)
Definition: sxrApi.h:355
Per-frame data needed for time warp, distortion/aberration correction.
Definition: sxrApi.h:323
SXRP_EXPORT bool sxrIsBoundarySystemEnabled()
Check whether the Boundary system is enabled.
int32_t minVsyncs
Minimum number of vysnc events before displaying the frame (1=display refresh, 2=half refresh...
Definition: sxrApi.h:326
Vulkan texture.
Definition: sxrApi.h:248
sxrViewFrustum leftEyeFrustum
Recommended Frustum information for left eye.
Definition: sxrApi.h:376
ANativeWindow * nativeWindow
Pointer to the Android native window.
Definition: sxrApi.h:223
uint32_t layerFlags
Flags applied to this render layer.
Definition: sxrApi.h:316
jobject javaActivityObject
Reference to the Android activity.
Definition: sxrApi.h:342
uint32_t deviceId
An identifier for the device that generated the event (0 == HMD)
Definition: sxrApi.h:426
sxrEventData eventData
Event specific data payload.
Definition: sxrApi.h:428
float targetFovYRad
Recommended vertical FOV.
Definition: sxrApi.h:375
float right
Right Plane of Frustum.
Definition: sxrApi.h:350
sxrLayerFlags
Enum used to indicate flags passed as part of a render layer.
Definition: sxrApi.h:122
int32_t poseStatus
Bit field (sxrTrackingMode) indicating pose status.
Definition: sxrApi.h:155
sxrWarpMeshType
Enumeration of possible warp mesh types.
Definition: sxrApi.h:272
int32_t leftEyePoseStatus
Bit field (sxrEyePoseStatus) indicating left eye pose status.
Definition: sxrApi.h:176
sxrEyePoseStatus
Structure containing flags indicating data valididty of an eye pose.
Definition: sxrApi.h:162
Structure containing parameters needed to enable VR mode.
Definition: sxrApi.h:218
Cubemap texture (Not supporting cubemap image)
Definition: sxrApi.h:247
sxrWarpType
Enum used to indicate the type of warp/composition that should be used for a frame.
Definition: sxrApi.h:265
sxrWarpType warpType
Type of warp to be used on the frame.
Definition: sxrApi.h:332
sxrControllerConnectionState connectionState
Controller Connection state.
Definition: sxrApi.h:554
Basic device information to allow the client code to optimally setup their simulation and rendering p...
Definition: sxrApi.h:366
sxrTrackingMode
Enum used to indicate valid components of an pose state.
Definition: sxrApi.h:144
Equirectangular texture.
Definition: sxrApi.h:245
SXRP_EXPORT SxrResult sxrRecenterOrientation(bool yawOnly=true)
Recenters the head orientation (Yaw only) at the current value.
SXRP_EXPORT uint32_t sxrGetTrackingMode()
Returns the current head tracking mode.
Minimum performance level.
Definition: sxrApi.h:203
float leftEyeOpenness
Left eye value between 0.0 and 1.0 where 1.0 means fully open and 0.0 closed.
Definition: sxrApi.h:188
Render layer screen position and UV coordinates.
Definition: sxrApi.h:295
Information about texture if type is kTypeVulkan.
Definition: sxrApi.h:253
uint32_t isTouching
Whether the touchpad area is being touched.
Definition: sxrApi.h:551
Description of render layers.
Definition: sxrApi.h:310
float rightEyeOpenness
Right eye value between 0.0 and 1.0 where 1.0 means fully open and 0.0 closed.
Definition: sxrApi.h:189
uint64_t poseFetchTimeNs
Time stamp when this pose was retrieved.
Definition: sxrApi.h:157
SXRP_EXPORT sxrHeadPoseState sxrGetHistoricHeadPose(int64_t timestampNs)
Retrieves a historic head pose.
sxrVector2 gain
Foveation Gain Rate [1, ...].
Definition: sxrApi.h:360
sxrEventType eventType
Type of event.
Definition: sxrApi.h:425
SXRP_EXPORT SxrResult sxrGetEyePose(sxrEyePoseState *pReturnPose)
Retrieves a current eye pose.
int64_t timestamp
Timestamp for the eye pose.
Definition: sxrApi.h:174
SXRP_EXPORT void sxrForceDisplayBoundarySystem(bool forceDisplayBoundary=true)
Enable/Disable the forced display of Boundary system.
Controller Touch button enumerations.
Definition: sxrApi.h:455
JNIEnv * javaEnv
Java Environment.
Definition: sxrApi.h:341
int32_t combinedEyePoseStatus
Bit field (sxrEyePoseStatus) indicating combined eye pose status.
Definition: sxrApi.h:178
sxrVector3 accelerometer
Accelerometer.
Definition: sxrApi.h:536
SXRP_EXPORT SxrResult sxrGetBoundaryParameters(float *pMinValues, float *pMaxValues, float *pVisibilityRadius)
Get parameters for the Boundary system.
SXRP_EXPORT SxrResult sxrEndEye(sxrWhichEye whichEye, sxrTextureType imageType=kTypeTexture)
Called after eye buffer is rendered but before frame is submitted.
sxrFoveation highFoveation
High foveation values.
Definition: sxrApi.h:384
SXRP_EXPORT SxrResult sxrShutdown()
Releases VR components.
SXRP_EXPORT SxrResult sxrRecenterPose()
Recenters the head position and orientation at the current values.
sxrThermalZone zone
Thermal zone.
Definition: sxrApi.h:413
SXRP_EXPORT int sxrControllerQuery(int controllerHandle, int what, void *memory, unsigned int memorySize)
make a query to the controller
Initialization parameters that are constant over the life-cycle of the application.
Definition: sxrApi.h:338
sxrHeadPose pose
Head pose.
Definition: sxrApi.h:154
sxrTextureType
Enum used to indicate the type of texture passed in as a render layer.
Definition: sxrApi.h:240
uint32_t active1DAnalogs
Active 1D Analogs Bitfield.
Definition: sxrApi.h:575
uint32_t buttonState
All digital button states as bitflags.
Definition: sxrApi.h:542
SXRP_EXPORT float sxrGetPredictedDisplayTimePipelined(unsigned int depth)
Calculates a predicted time when the current frame would be displayed. Allows for specifying the curr...
int32_t targetEyeHeightPixels
Recommended eye buffer height (pixels)
Definition: sxrApi.h:373
SXRP_EXPORT SxrResult sxrSubmitFrame(const sxrFrameParams *pFrameParams)
Submits a frame to asynchronous time warp.
Simple structure to hold quaternion data.
Definition: sxrApi.h:94
Basic single layer (world) warp.
Definition: sxrApi.h:267