VRG C++ API

If you are interested in integrating support for XTAL headsets into your custom software/project, you can use the VRG C++ API. The required header and loader files, along with example DirectX and OpenGL demos, are available in the Native Integration folder. Detailed description of functions, enums, and structures from the current API version (4.6.0) is below. 

vrgAcquireCameraImage

Acquires (locks) last camera frame. Frame is locked until vrgReleaseCameraImage is called.

VrgErrorCode vrgAcquireCameraImage(
const uint32_t deviceId,
const VrgCameraType cameraType,
const VrgCameraImageType imageType,
const uint32_t viewIndex,
const uint64_t lastFrameId,
VrgCameraImageimage
);
deviceId
Headset ID.
cameraType
Camera type.
imageType
Image type.
viewIndex
For camera types that supports multiple frames (left eye, right eye, etc.) this parameter can be used to specify requested frame.
lastFrameId
Specifies last frame that was returned by the API. In case there are no newer frames the API will return other value than VRG_ERROR_OK.
image
Image data of the frame in case VRG_ERROR_OK is returned..

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgAttachGraphicsDevice

Initializes headset’s rendering pipeline.

VrgErrorCode vrgAttachGraphicsDevice(
const uint32_t deviceId,
const VrgGraphicsApi type,
voidgraphicsDevice
);
deviceId
Headset to be initialized.
type
Graphics API type.
graphicsDevice
Handle to a graphics device. For VRG_API_DIRECTX_11 pass ID3D11Device. For VRG_API_OPENGL pass HGLRC.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN if initialization failed.

See also VrgGraphicsApi

vrgBeginFrame

Delimits the beginning of frame layers and metadata submission. Submitted resources are controlled by the VRG API exclusively until the vrgEndFrame is called. Any access during the submission may result in undefined behaviour. Headset’s rendering pipeline has to be initialized prior submission. See vrgAttachGraphicsDevice.

VrgErrorCode vrgBeginFrame(
const uint32_t deviceId
);
deviceId
Headset that will receive the frame data.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgCalibrateEyeTracking

Triggers a calibration process that will show calibration patterns on the display that the user needs to follow. This is necessary to determine correct eye positions and directions and needs to be called before reading eye pose or registering a callback.

VrgErrorCode vrgCalibrateEyeTracking(
const uint32_t deviceId
);
deviceId
Headset ID.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgCalibrateImu

Calibrate inertial measurement unit (IMU) of given headset.

VrgErrorCode vrgCalibrateImu(
const uint32_t deviceId
);
deviceId
Headset ID.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided.

vrgControllerTriggerHapticPulse

Triggers haptic pulse on controller.

VrgErrorCode vrgControllerTriggerHapticPulse(
const uint32_t controllerId,
const uint32_t axis,
const uint32_t duration
);
controllerId
Controller ID (returned by vrgEnumerateControllers() call).
axis
Axis on which haptic pulse will be active.
duration
Duration of pulse in microseconds (max. duration is 65 milliseconds).

Returns VRG_ERROR_OK, VRG_ERROR_INVALID_ARGUMENT.

vrgCreateSwapChain

Creates new swap-chain for given device using a given description.

VrgErrorCode vrgCreateSwapChain(
const uint32_t deviceId,
const VrgSwapChainDescswapChainDesc,
VrgSwapChainswapChain
);
deviceId
Headset for which swap-chain will be created.
swapChainDesc
Description of the swap-chain.
swapChain
Opaque swap-chain handle that will be filled with newly created swap-chain.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK, VRG_ERROR_UNKNOWN

See also VrgSwapChainDesc, VrgSwapChain, vrgCreateSwapChainDX12

vrgCreateSwapChainDX12

Creates new swap-chain for given device using a given description.

VrgErrorCode vrgCreateSwapChainDX12(
const uint32_t deviceId,
const VrgSwapChainDescswapChainDesc,
ID3D12CommandQueuecommandQueue,
VrgSwapChainswapChain
);
deviceId
Headset for which swap-chain will be created.
swapChainDesc
Description of the swap-chain.
commandQueue
Command queue that will be used for rendering to this swapchain texture.
swapChain
Opaque swap-chain handle that will be filled with newly created swap-chain.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK, VRG_ERROR_UNKNOWN

See also VrgSwapChainDesc, VrgSwapChain

vrgCreateSwapChainDX12ClearValue

Creates new swap-chain for given device using a given description.

VrgErrorCode vrgCreateSwapChainDX12ClearValue(
const uint32_t deviceId,
const VrgSwapChainDescswapChainDesc,
ID3D12CommandQueuecommandQueue,
const D3D12_CLEAR_VALUEclearValue,
VrgSwapChainswapChain
);
deviceId
Headset for which swap-chain will be created.
swapChainDesc
Description of the swap-chain.
commandQueue
Command queue that will be used for rendering to this swapchain texture.
clearValue
Clear value.
swapChain
Opaque swap-chain handle that will be filled with newly created swap-chain.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK, VRG_ERROR_UNKNOWN

See also VrgSwapChainDesc, VrgSwapChain

vrgDestroySwapChain

Destroys swap-chain previously created by vrgCreateSwapChain.

VrgErrorCode vrgDestroySwapChain(
const uint32_t deviceId,
VrgSwapChainswapChain
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle to be deleted.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain, vrgCreateSwapChain

vrgEndFrame

Delimits the end of frame layers and metadata submission. The control of submitted resources is returned back to the user.

VrgErrorCode vrgEndFrame(
const uint32_t deviceId
);
deviceId
Headset ID.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN.

vrgEnumerateCameraProfiles

Enumerates available camera profiles (resolution and framerate).

VrgErrorCode vrgEnumerateCameraProfiles(
const uint32_t deviceId,
const VrgCameraType cameraType,
uint32_tcount,
VrgCameraProfileprofiles
);
deviceId
Headset ID.
cameraType
Camera type for which profiles will be enumerated.
count
Count parameter interpretation depends on value of the profiles argument. If the profiles argument is NULL then count is output argument and represent the number of all available profiles. If the profiles argument is not NULL then count is input argument and represents size of profiles array. At most count devices will be stored in the profiles array.
profiles
Array of VrgCameraProfile that will contain descriptors of available profiles. NULL may be passed. Allocated by the user.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgEnumerateControllers

Enumerate available controllers attached to the system.

VrgErrorCode vrgEnumerateControllers(
uint32_tcount,
uint32_tids
);
count
Count parameter interpretation depends on value of the ids argument. If the ids argument is NULL then count is output argument and represent the number of all available controllers. If the ids argument is not NULL then count is input argument and represents size of ids array. At most count controller IDs will be stored in the ids array.
ids
Array of uint32_t that will contain descriptors of available controllers. NULL may be passed. Allocated by the user.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_INVALID_ARGUMENT if invalid pointer for count is given, VRG_ERROR_INCOMPLETE if more then count items are available.

vrgEnumerateDevices

Enumerate all available VRG headsets currently attached to the system.

VrgErrorCode vrgEnumerateDevices(
uint32_tcount,
VrgDevicedevices
);
count
Count parameter interpretation depends on value of the devices argument. If the devices argument is NULL then count is output argument and represent the number of all available headsets. If the devices argument is not NULL then count is input argument and represents size of devices array. At most count devices will be stored in the devices array.
devices
Array of VrgDevice that will contain descriptors of available headsets. NULL may be passed. Allocated by the user.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_INVALID_ARGUMENT if invalid pointer for count is given, VRG_ERROR_INCOMPLETE if more then count items are available.

See also VrgDevice

vrgEnumerateTrackingSystems

Enumerate available tracking systems supported by current VRG API version. Usually the VRG API takes care of tracking systems (tray menu). You don’t have to call this function unless you want to manually manage and expose tracking systems in your application.

VrgErrorCode vrgEnumerateTrackingSystems(
uint32_tcount,
VrgTrackingSystemtrackingSystems
);
count
Count parameter interpretation depends on value of the trackingSystems argument. If the trackingSystems argument is NULL then count is output argument and represent the number of all available tracking systems. If the trackingSystems argument is not NULL then count is input argument and represents size of trackingSystems array. At most count tracking systems will be stored in the trackingSystems array.
trackingSystems
Array of VrgTrackingSystem that will contain descriptors of available tracking systems. NULL may be passed. Allocated by the user.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_INVALID_ARGUMENT if invalid pointer for count is given, VRG_ERROR_INCOMPLETE if more then count items are available.

vrgFreeApi

Releases and unloads the VRG API. This function has to be called once all the work with VRG SDK is done.

VrgErrorCode vrgFreeApi(
);

VRG_ERROR_OK, VRG_ERROR_UNKNOWN.

Returns VRG_ERROR_OK, VRG_ERROR_UNKNOWN.

vrgFreeCamera

Deinitializes camera previously initizalized by vrgInitCamera.

VrgErrorCode vrgFreeCamera(
const uint32_t deviceId,
const VrgCameraType cameraType
);
deviceId
Headset ID.
cameraType
Camera type.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgFreeDevice

Releases the headset and closes the connection to it making it available for other applications.

VrgErrorCode vrgFreeDevice(
const uint32_t deviceId
);
deviceId
Headset ID.

Returns VRG_ERROR_OK.

vrgGetBool

Returns current value of a bool property of a given headset.

VrgErrorCode vrgGetBool(
const uint32_t deviceId,
const VrgBoolProperty flag,
uint32_tenabled
);
deviceId
Headset ID.
flag
Bool property to be retrieved.
enabled
Pointer to a variable which will be filled with the current property value. Value of 0 means the property is disabled. Non-zero value means the property is enabled.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided, VRG_ERROR_UNKNOWN if other error occured.

See also vrgSetBool, VrgBoolProperty

vrgGetCameraRunning

Queries the state of given camera type.

VrgErrorCode vrgGetCameraRunning(
const uint32_t deviceId,
const VrgCameraType cameraType,
intisRunning
);
deviceId
Headset ID.
cameraType
Camera type.
isRunning
Output argument, set to 1 if given camera type is running, 0 otherwise.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_UNKNOWN

vrgGetControllerData

Gets positional data of a tracking system controller.

VrgErrorCode vrgGetControllerData(
const uint32_t controllerId,
VrgControllerDatacontrollerData
);
controllerId
Controller ID (returned by vrgEnumerateControllers() call).
controllerData
Output controller data. Allocated by the user.

Returns VRG_ERROR_OK, VRG_ERROR_TRACKER_NOT_FOUND.

See also VrgControllerData

vrgGetErrorMessage

Returns string representation of a given error code.

VrgErrorCode vrgGetErrorMessage(
const VrgErrorCode errorCode,
const char ** message
);
errorCode
Error code returned from one of the VRG API calls.
message
Pointer to string that will contain string represenation of the error code. Allocated and owned by the VRG API.

Returns VRG_ERROR_OK if textual representation exists, VRG_ERROR_INVALID_ARGUMENT otherwise.

vrgGetFloat

Returns float property of a given headset.

VrgErrorCode vrgGetFloat(
const uint32_t deviceId,
const VrgFloatProperty property,
floatvalue
);
deviceId
Headset ID.
property
Property to be retrieved.
value
Pointer to a variable which will be filled with the current property value.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided, VRG_ERROR_UNKNOWN if other error occured.

See also vrgSetFloat, VrgFloatProperty

vrgGetFov

Returns field of view (angle tangents) property of a given headset.

VrgErrorCode vrgGetFov(
const uint32_t deviceId,
const VrgFovProperty property,
VrgFovfov
);
deviceId
Headset ID.
property
Property to be retrieved.
fov
Pointer to variable that will be filled with field of view property values. Allocated by the user.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided.

See also VrgFovProperty

vrgGetHandData

Gets hand data in absolute coordinates.

VrgErrorCode vrgGetHandData(
const uint32_t deviceId,
const VrgHand hand,
VrgHandDatahandData
);
deviceId
Headset ID.
hand
Hand designator. Left or right.
handData
Output hand data. Allocated by the used.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

See also VrgHand, VrVrgHandData

vrgGetHandRelativeData

Gets hand data in coordinates relative to the headset.

VrgErrorCode vrgGetHandRelativeData(
const uint32_t deviceId,
const VrgHand hand,
VrgHandDatahandData
);
deviceId
Headset ID.
hand
Hand designator. Left or right.
handData
Output hand data. Allocated by the used.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

See also VrgHand, VrVrgHandData

vrgGetInt

Returns int property of a given headset.

VrgErrorCode vrgGetInt(
const uint32_t deviceId,
const VrgIntProperty property,
intvalue
);
deviceId
Headset ID.
property
Property to be retrieved.
value
Pointer to a variable which will be filled with the current property value.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided, VRG_ERROR_UNKNOWN if other error occured.

See also vrgGetFloat, VrgIntProperty

vrgGetMrVisibleMarkers

Returns set of detected MR markers.

VrgErrorCode vrgGetMrVisibleMarkers(
const uint32_t deviceId,
uint32_tcount,
VrgMrMarkermarkers
);
deviceId
Headset ID.
count
Count parameter interpretation depends on value of the markers argument. If the markers argument is NULL then count is output argument and represent the number of detected markers. If the markers argument is not NULL then count is input argument and represents size of markers array. At most count markers will be stored in the markers array.
markers
Array of markers. NULL may be passed. Allocated by the user.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgGetPoseEx

Gets pose of an object identified by property .

VrgErrorCode vrgGetPoseEx(
const uint32_t deviceId,
const VrgPoseProperty property,
VrgPosepose
);
deviceId
Headset to be queried.
property
Queried pose property.
pose
Output pose. Allocated by the user.

All poses are returned in right-handed cartesian coordinate system. Neutral pose has positive axis Y oriented up, positive axis X oriented to the right and negative Z axis oriented forward.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_INVALID_ARGUMENT if property is not valid or pose is NULL.

vrgGetString

Returns string property of a given headset.

VrgErrorCode vrgGetString(
const uint32_t deviceId,
VrgStringProperty property,
uint32_tcount,
charvalue
);
deviceId
Headset ID.
property
Property to be retrieved.
count
Count parameter interpretation depends on value of the value argument. If the value argument is NULL then count is output argument and represent the number of characters. If the value argument is not NULL then count is input argument and represents size of devices array. At most count characters will be stored in the value array.
value
Array of char that will contain the string value of the property. NULL may be passed. Allocated by the user.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided, VRG_ERROR_UNKNOWN if other error occured.

See also VrgStringProperty

vrgInitApi

Initializes the VRG API. This function has to be called before any other API calls.

VrgErrorCode vrgInitApi(
const VrgInitInfoinfo
);
info
Initialization information e.g. API version. Use VRG_API_INIT_INFO as a default.

Returns VRG_ERROR_OK, VRG_ERROR_INVALID_ARGUMENT.

vrgInitCamera

Initializes a hmd camera with given type and profile.

VrgErrorCode vrgInitCamera(
const uint32_t deviceId,
const VrgCameraType cameraType,
const VrgCameraProfileprofile,
VrgCameraInfooutInitInfo
);
deviceId
Headset ID.
cameraType
Camera type.
profile
Profile a camera will be initialized with. If NULL is passed then default resolution and framerate are used.
outInitInfo
Output argument containing details about initialized camera.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgInitCameraImageType

Initializes camera frames swpachain. API allows you get frames stored in VRAM directly.

VrgErrorCode vrgInitCameraImageType(
const uint32_t deviceId,
const VrgCameraType cameraType,
const VrgCameraImageType imageType,
voidcontext
);
deviceId
Headset ID.
cameraType
Camera type.
imageType
Requested image type of camera swapchain. API can provide images in native representations i.e. RAM, D3D11 texture, CUDA memory, OpenGL texture. This function can be called more then once with different image types. In this case multiple camera image representations will be available. See vrgAcquireCameraImage.
context
When using image type VRG_CAMERA_IMAGE_TYPE_GPU_D3D11 then ID3D11Device should be passed as context. Otherwise NULL value is used.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgInitDevice

Initializes the headset for use and opens a connection to it. This has to be called before any other API calls that require deviceId . Get the ID by enumerating connected devices vrgEnumerateDevices .

VrgErrorCode vrgInitDevice(
const uint32_t deviceId
);
deviceId
Headset ID.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_AVAILABLE.

See also vrgEnumerateDevices

vrgInitTrackingSystem

Sets active tracking system of given headset. Usually the VRG API takes care of tracking systems (tray menu). You don’t have to call this function unless you want to manually manage and expose tracking systems in your application.

VrgErrorCode vrgInitTrackingSystem(
const uint32_t deviceId,
const uint32_t trackerSystemId
);
deviceId
Headset for which new tracking is set.
trackerSystemId
Tracking system ID (returned by vrgEnumerateTrackingSystems call).

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT is invalid device Id is provided, VRG_ERROR_TRACKER_NOT_FOUND if invalid trackerSystemId is provided.

See also vrgEnumerateTrackingSystems

vrgIsNewCameraImageAvailable

Checks if new frame for given camera type and image type is available and can be acquired with vrgAcquireCameraImage.

VrgErrorCode vrgIsNewCameraImageAvailable(
const uint32_t deviceId,
const VrgCameraType cameraType,
const VrgCameraImageType imageType,
const uint32_t viewIndex,
const uint64_t lastFrameId,
uint32_tnewImageAvailable
);
deviceId
Headset ID.
cameraType
Camera type.
imageType
Image type.
viewIndex
See vrgAcquireCameraImage.
lastFrameId
ID of a last frame acquired by vrgAcquireCameraImage.
newImageAvailable
Pointer to uint32_t where number of available frames for camera will be stored.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgRegisterEyePoseCallback

Registers a callback that will periodically report eye pose at specified frequency.

VrgErrorCode vrgRegisterEyePoseCallback(
const uint32_t deviceId,
uint32_t frequencyHz,
VrgEyePoseCallback callback
);
deviceId
Headset ID.
frequencyHz
Frequency in hertz that eye pose will be reported. Valid range is (0, 120>.
callback
A function pointer to VrgEyePoseCallback. Pass NULL to unregister.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgReleaseCameraImage

Releases (unlocks) frame previously acquired by vrgAcquireCameraImage.

VrgErrorCode vrgReleaseCameraImage(
const uint32_t deviceId,
const VrgCameraType cameraType,
const VrgCameraImageType imageType,
const uint32_t viewIndex,
const uint64_t lastFrameId
);
deviceId
Headset ID.
cameraType
Camera type.
imageType
Image type.
viewIndex
See vrgAcquireCameraImage.
lastFrameId
Specifies frame id that should be released.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgResetTrackingSystemOrigin

Resets tracking position origin previously set by vrgSetTrackingSystemOrigin. Headset position returned by vrgGetPoseEx function call will depend on the actual tracking system being used. Usually the VRG API takes care of tracking system calibration (tray menu). You don’t have to call this function unless you want to manually manage and expose tracking system calibration in your application.

VrgErrorCode vrgResetTrackingSystemOrigin(
const uint32_t deviceId
);
deviceId
Headset for which origin will be reset.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT is invalid device Id is provided.

See also vrgSetTrackingSystemOrigin, vrgGetPoseEx

vrgRunAutoInterpupillaryDistance

Sets interpupillary distance automatically.

VrgErrorCode vrgRunAutoInterpupillaryDistance(
const uint32_t deviceId
);
deviceId
Headset ID.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgSetBool

Sets bool property of a given headset.

VrgErrorCode vrgSetBool(
const uint32_t deviceId,
const VrgBoolProperty flag,
const uint32_t enabled
);
deviceId
Headset ID.
flag
Bool property to be changed.
enabled
New value for given property. Value of 0 will disable given property, non-zero values will enable it.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided, VRG_ERROR_UNKNOWN if other error occured.

See also vrgGetBool, VrgBoolProperty

vrgSetDepthMapping

Sets how user-provided depth buffer values are mapped to Z coordinates i.e. determines interpretation of depth VRG_LAYER_LEFT_DEPTH and VRG_LAYER_RIGHT_DEPTH. It is necessary to set the right mapping for spacewarp feature to work correctly.

VrgErrorCode vrgSetDepthMapping(
uint32_t deviceId,
VrgDepthMapping depthMapping
);
deviceId
Headset ID.
depthMapping
Depth mapping type.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

See also vrgSubmitFrameLayer

vrgSetExternalTrackingPose

Sets tracking position for when tracking system is set to “External”.

VrgErrorCode vrgSetExternalTrackingPose(
const uint32_t deviceId,
const VrgPosepose
);
deviceId
Headset ID.
pose
New pose for external tracking.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_INVALID_ARGUMENT

vrgSetFloat

Sets float property of a given headset.

VrgErrorCode vrgSetFloat(
const uint32_t deviceId,
const VrgFloatProperty property,
const float value
);
deviceId
Headset ID.
property
Property to be changed.
value
New value for given property.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided, VRG_ERROR_UNKNOWN if other error occured.

See also vrgGetFloat, VrgFloatProperty

vrgSetInt

Sets int property of a given headset.

VrgErrorCode vrgSetInt(
const uint32_t deviceId,
const VrgIntProperty property,
const int value
);
deviceId
Headset ID.
property
Property to be changed.
value
New value for given property.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_INVALID_ARGUMENT if invalid property is provided, VRG_ERROR_UNKNOWN if other error occured.

See also vrgGetInt, VrgIntProperty

vrgSetMrMarkerType

Sets MR marker type. Change of MR marker type will be effective next time MR marker detector is enabled by settings bool property VRG_BOOL_MR_MARKER_DETECTOR to 1. If detector is already running it needs to be stopped first by setting bool property VRG_BOOL_MR_MARKER_DETECTOR to 0.

VrgErrorCode vrgSetMrMarkerType(
const uint32_t deviceId,
VrgMrMarkerType type
);
deviceId
Headset ID.
type
Type of MR marker dictionary.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgSetMrOverlayMasking

Sets mixed reality video stream masking configuration.

VrgErrorCode vrgSetMrOverlayMasking(
const uint32_t deviceId,
const VrgMrOverlayMaskingmasking
);
deviceId
Headset ID.
masking
New configuration for video stream masking.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgSetMrOverlayMode

Sets mixed reality video stream overlay mode.

VrgErrorCode vrgSetMrOverlayMode(
const uint32_t deviceId,
const VrgMrOverlayMode mode
);
deviceId
Headset ID.
mode
Display mode of the overlay.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgSetMrOverlayVisible

Sets mixed reality video stream overlay visible.

VrgErrorCode vrgSetMrOverlayVisible(
const uint32_t deviceId,
const uint32_t visible,
const VrgCameraProfileprofile
);
deviceId
Headset ID.
visible
Set 1 to show overlay, 0 to hide.
profile
Obsolete parameter, can be null. To set camera overlay profile first initialize camera with call to vrgInitCamera.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT

vrgSetTrackingSystemOrigin

Sets current position returned from tracking system as a new origin for tracking. Headset position returned by vrgGetPoseEx function call will be relative to the position in which headset was located when vrgSetTrackingSystemOrigin was called. The origin is part of the headset settings and is persistent across multiple run instances. The origin can be reset by calling vrgResetTrackingSystemOrigin. Usually the VRG API takes care of tracking system calibration (tray menu). You don’t have to call this function unless you want to manually manage and expose tracking system calibration in your application.

VrgErrorCode vrgSetTrackingSystemOrigin(
const uint32_t deviceId
);
deviceId
Headset for which new origin will be set.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT is invalid device Id is provided.

See also vrgResetTrackingSystemOrigin, vrgGetPoseEx

vrgStartCamera

Starts a camera of a given time. Once camera starts it will provide new frames.

VrgErrorCode vrgStartCamera(
const uint32_t deviceId,
const VrgCameraType cameraType
);
deviceId
Headset ID.
cameraType
Camera type.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgStopCamera

Stops a camera previously started by vrgStartCamera.

VrgErrorCode vrgStopCamera(
const uint32_t deviceId,
const VrgCameraType cameraType
);
deviceId
Headset ID.
cameraType
Camera type.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN

vrgSubmitFrameClipPlanes

Sets near and far clipping planes that given frame layer was rendered with. without these values spacewarp reprojection can’t be used.

VrgErrorCode vrgSubmitFrameClipPlanes(
const uint32_t deviceId,
const VrgFrameLayer layer,
const float nearPlane,
const float farPlane
);
deviceId
Headset that will receive the metadata.
layer
Frame layer designation.
nearPlane
Frame layer field of view.
farPlane
Frame layer field of view.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_INVALID_ARGUMENT.

See also VrgFrameLayer, VrgFov

vrgSubmitFrameCoordinates

Sets texture coordinates for given frame layer.

VrgErrorCode vrgSubmitFrameCoordinates(
const uint32_t deviceId,
const VrgFrameLayer layer,
float uMin,
float vMin,
float uMax,
float vMax
);
deviceId
Headset for which layer coordinates are set.
layer
Frame layer designation.
uMin
Minimal horizontal texture coordinate.
vMin
Minimal vertical texture coordinate.
uMax
Maximal horizontal texture coordinate.
vMax
Maximal vertical texture coordinate.

Default values are used if vrgSubmitFrameCoordinates was never called for given layer. Default values depend on target graphics API. Coordinates from previus call of vrgSubmitFrameCoordinates for the layer will be reused.

Returns VRG_ERROR_OK if no error occured, VRG_ERROR_HMD_NOT_PRESENT if invalid deviceId is provided, VRG_ERROR_UNKNOWN if other error occured.

See also VrgFrameLayer

vrgSubmitFrameFov

Sets the field of view (angle tangents) that given frame layer was rendered with. If no field of view is set for given layer then default values are used if no prior vrgSubmitFrameFov was called for given layer. Default values are those that are returned by vrgGetFov call. Otherwise values from last call of vrgSubmitFrameFov for same layer are used.

VrgErrorCode vrgSubmitFrameFov(
const uint32_t deviceId,
const VrgFrameLayer layer,
const VrgFovfov
);
deviceId
Headset that will receive the metadata.
layer
Frame layer designation.
fov
Frame layer field of view.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_INVALID_ARGUMENT.

See also VrgFrameLayer, VrgFov, vrgGetFov

vrgSubmitFrameLayer

Submits a frame layer to the rendering pipeline designated by layer .

VrgErrorCode vrgSubmitFrameLayer(
const uint32_t deviceId,
const VrgFrameLayer layer,
voidtexture
);
deviceId
Headset that will receive the frame layer.
layer
Frame layer designation.
texture
Texture resource. For VRG_API_DIRECTX_11 pass ID3D11Texture2D. For VRG_API_OPENGL pass address of GLuint.

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_UNKNOWN.

See also VrgFrameLayer

vrgSubmitFramePose

Sets headset pose that given frame layer was rendered with.

VrgErrorCode vrgSubmitFramePose(
const uint32_t deviceId,
const VrgFrameLayer layer,
const VrgPosepose
);
deviceId
Headset that will receive the metadata.
layer
Frame layer designation.
pose
Submitted layer pose. For base layers (VRG_LAYER_LEFT and VRG_LAYER_RIGHT) the pose is expected to be in world space, i.e. it should be combination of pose returned by call to vrgGetPoseEx(…, VRG_POSE_HMD, …) and pose returned by call to vrgGetPoseEx(…, VRG_POSE_LEFT, …) (and VRG_POSE_RIGHT respectively). On the other hand poses for detail layers (VRG_LAYER_LEFT_DETAIL and VRG_LAYER_RIGHT_DETAIL) are expected to be in HMD space, i.e. they translate directly to poses returned by call to vrgGetPoseEx(…, VRG_POSE_CAMERA_LEFT_DETAIL, …) (and VRG_POSE_CAMERA_RIGHT_DETAIL respectively).

Returns VRG_ERROR_OK, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_INVALID_ARGUMENT.

See also VrgFrameLayer, VrgPose, vrgGetPoseEx

vrgSwapChainCurrentIndex

Obtains next index of a texture in given swap-chain that can be used in current frame. This function is blocking. To avoid stalling the swap-chain shoud be created with at least 3 or more textures.

VrgErrorCode vrgSwapChainCurrentIndex(
const uint32_t deviceId,
VrgSwapChainswapChain,
uint32_tindex
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle.
index
Output parameter that will contain index of available texture for current frame.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain, vrgSwapChainGetTexture, vrgSwapChainCurrentIndexVulkan

vrgSwapChainCurrentIndexEx

Obtains next index of a texture in given swap-chain that can be used in current frame. This function is blocking. To avoid stalling the swap-chain shoud be created with at least 3 or more textures. This is an extended version with API-specific synchronization scheme.

VrgErrorCode vrgSwapChainCurrentIndexEx(
const uint32_t deviceId,
VrgSwapChainswapChain,
uint32_tindex,
voidsync
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle.
index
Output parameter that will contain index of available texture for current frame.
sync
Pointer to API-specific synchronization object. For Vulkan this function expects pointer to VrgVulkanSwapchainSync.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain, vrgSwapChainGetTexture

vrgSwapChainCurrentIndexVulkan

Obtains next index of a texture in given swap-chain that can be used in current frame. This function is blocking. To avoid stalling the swap-chain shoud be created with at least 3 or more textures. This is an extended version with API-specific synchronization scheme.

VrgErrorCode vrgSwapChainCurrentIndexVulkan(
const uint32_t deviceId,
VrgSwapChainswapChain,
uint32_tindex,
VrgVulkanSwapchainSyncsync
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle.
index
Output parameter that will contain index of available texture for current frame.
sync
Pointer to VrgVulkanSwapchainSync synchronization object.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain, vrgSwapChainGetTexture

vrgSwapChainGetTexture

Obtains raw pointer to native texture in given swap-chain at given index.

VrgErrorCode vrgSwapChainGetTexture(
const uint32_t deviceId,
const VrgSwapChainswapChain,
const uint32_t index,
void ** texture
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle.
index
Index in the swap-chain for which texture will be returned.
texture
Output parameter that will contain raw pointer to native texture.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain, vrgSwapChainGetTextureDX12, vrgSwapChainGetTextureVulkan

vrgSwapChainGetTextureDX11

Obtains raw pointer to native texture in given swap-chain at given index.

VrgErrorCode vrgSwapChainGetTextureDX11(
const uint32_t deviceId,
const VrgSwapChainswapChain,
const uint32_t index,
ID3D11Texture2D ** texture
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle.
index
Index in the swap-chain for which texture will be returned.
texture
Output parameter that will contain pointer to DX11 texture resource.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain

vrgSwapChainGetTextureDX12

Obtains pointer to native texture in given swap-chain at given index.

VrgErrorCode vrgSwapChainGetTextureDX12(
const uint32_t deviceId,
const VrgSwapChainswapChain,
const uint32_t index,
ID3D12Resource ** texture
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle.
index
Index in the swap-chain for which texture will be returned.
texture
Output parameter that will contain pointer to DX12 texture resource.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain

vrgSwapChainGetTextureVulkan

Obtains raw pointer to native texture in given swap-chain at given index.

VrgErrorCode vrgSwapChainGetTextureVulkan(
const uint32_t deviceId,
const VrgSwapChainswapChain,
const uint32_t index,
VkImagetexture
);
deviceId
Headset swap-chain belongs to.
swapChain
Swap-chain handle.
index
Index in the swap-chain for which texture will be returned.
texture
Output parameter that will contain raw pointer to native texture.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgSwapChain

vrgVrsTextureUpdate

Updates content of VRS texture for given layer.

VrgErrorCode vrgVrsTextureUpdate(
const uint32_t deviceId,
const VrgFrameLayer layer,
const voidvrsUpdate
);
deviceId
Headset for which VRS texture will be updated.
layer
Target layer.
vrsUpdate
Pointer to graphics API specific data.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgVrsTextureUpdateFlags, VrgDx12VrsTextureUpdate, vrgVrsTextureUpdateDX12

vrgVrsTextureUpdateDX12

Updates content of VRS texture for given layer.

VrgErrorCode vrgVrsTextureUpdateDX12(
const uint32_t deviceId,
const VrgFrameLayer layer,
const VrgDx12VrsTextureUpdatevrsUpdate
);
deviceId
Headset for which VRS texture will be updated.
layer
Target layer.
vrsUpdate
Pointer to graphics API specific data.

Returns VRG_ERROR_INVALID_ARGUMENT, VRG_ERROR_HMD_NOT_PRESENT, VRG_ERROR_OK

See also VrgVrsTextureUpdateFlags, VrgDx12VrsTextureUpdate

VrgErrorCode

Error codes returned by VRG API. Get detailed error description by calling vrgGetErrorMessage.

VRG_ERROR_OK 0
VRG_ERROR_DP_NOT_CONNECTED 1
VRG_ERROR_UNKNOWN 4
VRG_ERROR_INCOMPLETE 5
VRG_ERROR_UNCHANGED 6
VRG_ERROR_INVALID_ARGUMENT 7
VRG_ERROR_NOT_IMPLEMENTED 8
VRG_ERROR_HMD_NOT_AVAILABLE 9
VRG_ERROR_NOT_INITIALIZED 10
VRG_ERROR_INVALID_VERSION 11
VRG_ERROR_API_LOAD 12
VRG_ERROR_HMD_NOT_PRESENT -1
VRG_ERROR_TRACKER_NOT_FOUND -2
VRG_ERROR_CANNOT_SET_IPD -5
VRG_ERROR_NOT_SUPPORTED -6
VRG_ERROR_IN_PROGRESS -7

See also vrgGetErrorMessage

VrgGraphicsApi

Graphics API type. Determines headset’s rendering pipeline input resources format.

VRG_API_DIRECTX_11 0
VRG_API_DIRECTX_12 1
VRG_API_OPENGL 2
VRG_API_VULKAN 3

VrgHand

Hand tracking hand identification.

VRG_HAND_LEFT 0
VRG_HAND_RIGHT 1

VrgFinger

Hand tracking finger identification.

VRG_FINGER_THUMB 0
VRG_FINGER_INDEX 1
VRG_FINGER_MIDDLE 2
VRG_FINGER_RING 3
VRG_FINGER_LITTLE 4

VrgFingerBone

Hand tracking finger bone identification.

VRG_FINGER_BONE_METACARPAL 0
VRG_FINGER_BONE_PROXIMAL 1
VRG_FINGER_BONE_INTERMEDIATE 2
VRG_FINGER_BONE_DISTAL 3

VrgFrameLayer

Frame layer identification for the headset rendering pipeline compositor.

VRG_LAYER_LEFT 0
VRG_LAYER_RIGHT 1
VRG_LAYER_LEFT_DETAIL 3
VRG_LAYER_RIGHT_DETAIL 4
VRG_LAYER_LEFT_OVERLAY 5
VRG_LAYER_RIGHT_OVERLAY 6
VRG_LAYER_LEFT_DEPTH 7
VRG_LAYER_RIGHT_DEPTH 8
VRG_LAYER_LEFT_MR_MASK 9
VRG_LAYER_RIGHT_MR_MASK 10

VrgBoolProperty

Headset boolean properties.

VRG_BOOL_IMU 0 Enables or disables IMU. Enabled by default.
VRG_BOOL_TRAY_MENU 1 Enables or disables tray menu. Enabled by default.
VRG_BOOL_ASYNC_TIMEWARP 2
VRG_BOOL_HAND_TRACKING 3
VRG_BOOL_EYE_TRACKING 4
VRG_BOOL_STATUS_MESSAGES 5
VRG_BOOL_DYNAMIC_RENDER_TARGET_RESOLUTION 6
VRG_BOOL_SRGB 7 Enables SRGB mode. Disabled by default. Can’t be changed after calling vrgAttachGraphicsDevice.
VRG_BOOL_FOVEATED_RENDER 8
VRG_BOOL_EXTERNAL_TRACKING 9
VRG_BOOL_EXTERNAL_TRACKING_MERGE 10
VRG_BOOL_POSITION_TRACKING 11
VRG_BOOL_MIXED_REALITY_AVAILABLE 12 Read-only property to obtain Mixed reality support of current headset.
VRG_BOOL_ALPHA_CHANNEL 13 Enables alpha channel mode. By default alpha channel of submitted textures is ignored.
VRG_BOOL_REMOTE_MIXED_REALITY_AVAILABLE 14
VRG_BOOL_MR_MARKER_DETECTOR 15
VRG_BOOL_DETAIL_LAYER_WORLD_SPACE_POSE 16 By default vrgSubmitFramePose for VRG_LAYER_LEFT_DETAIL and VRG_LAYER_RIGHT_DETAIL expects pose relative to base layer pose. By turning on the option VRG_BOOL_DETAIL_LAYER_WORLD_SPACE_POSE those poses will be expected in world space.
VRG_BOOL_SWAPCHAIN_TYPELESS 17 In graphics API that supports it swapchain textures will be created with their associated TYPELESS format.

See also vrgGetBool, vrgSetBool

VrgFovProperty

Headset field of view properties.

VRG_FOV_LEFT 0
VRG_FOV_RIGHT 1
VRG_FOV_LEFT_DETAIL 2
VRG_FOV_RIGHT_DETAIL 3
VRG_FOV_LEFT_MR_CAMERA 4
VRG_FOV_RIGHT_MR_CAMERA 5

See also vrgFov

VrgFloatProperty

Headset float properties.

VRG_FLOAT_HMD_POSE_PREDICTION_MS 1
VRG_FLOAT_PUPILLARY_DISTANCE_LEFT_M 2
VRG_FLOAT_PUPILLARY_DISTANCE_RIGHT_M 3
VRG_FLOAT_EYE_RELIEF_M 4
VRG_FLOAT_EYE_TO_LENS_DISTANCE 5
VRG_FLOAT_MINIMUM_LENS_DISTANCE 6

See also vrgGetFloat, vrgSetFloat

VrgIntProperty

Headset integer properties.

VRG_INT_DISPLAY_RESOLUTION_WIDTH 0
VRG_INT_DISPLAY_RESOLUTION_HEIGHT 1
VRG_INT_DISPLAY_FRAMERATE 2
VRG_INT_RENDER_TARGET_WIDTH 3
VRG_INT_RENDER_TARGET_HEIGHT 4
VRG_INT_RENDER_TARGET_DETAIL_WIDTH 5
VRG_INT_RENDER_TARGET_DETAIL_HEIGHT 6

See also vrgGetInt, vrgSetInt

VrgCameraType

Available camera type.

VRG_CAMERA_TYPE_AR 0
VRG_CAMERA_TYPE_EYE 1
VRG_CAMERA_TYPE_LEAP_MOTION 2

See also vrgInitCamera

VrgStringProperty

Headset string properties.

VRG_STRING_SERIAL_NUMBER 4400

See also vrgGetString

VrgPoseProperty

Headset pose properties.

VRG_POSE_HMD 0
VRG_POSE_CAMERA_LEFT 1
VRG_POSE_CAMERA_RIGHT 2
VRG_POSE_CAMERA_LEFT_DETAIL 3
VRG_POSE_CAMERA_RIGHT_DETAIL 4
VRG_POSE_EYE_LEFT 5
VRG_POSE_EYE_RIGHT 6
VRG_POSE_MR_CAMERA_LEFT 7
VRG_POSE_MR_CAMERA_RIGHT 8

See also vrgGetPoseEx

VrgImageFormat

Image format.

VRG_IMAGE_FORMAT_UNKNOWN 0
VRG_IMAGE_FORMAT_R8G8B8A8 1
VRG_IMAGE_FORMAT_GRAY8 2

See also VrgCameraImage

VrgCameraImageType

Image camera image type.

VRG_CAMERA_IMAGE_TYPE_CPU_RAM 1
VRG_CAMERA_IMAGE_TYPE_GPU_CUDA 2
VRG_CAMERA_IMAGE_TYPE_GPU_D3D11 4
VRG_CAMERA_IMAGE_TYPE_GPU_OPENGL 8

See also VrgCameraImageType

VrgDepthMapping

Deph buffer values mapping.

VRG_DEPTH_ZERO_TO_ONE 0
VRG_DEPTH_ONE_TO_ZERO 1
VRG_DEPTH_MINUS_ONE_TO_ONE 2
VRG_DEPTH_ZERO_TO_INFINITY 3
VRG_DEPTH_ONE_TO_INFINITY 4

VrgTextureFormat

Texture formats available for swap-chain creation.

VRG_FORMAT_R8G8B8A8_SRGB 0
VRG_FORMAT_R8G8B8A8_UNORM 1
VRG_FORMAT_R8G8B8A8_UINT 2
VRG_FORMAT_D24_UNORM_S8_UINT 3
VRG_FORMAT_B8G8R8A8_SRGB 4
VRG_FORMAT_B8G8R8A8_UNORM 5
VRG_FORMAT_D32_FLOAT 6
VRG_FORMAT_D32_FLOAT_S8X24_UINT 7

See also VrgSwapChainDesc

VrgTextureBindFlags

Texture usage available for swap-chain creation.

VRG_BIND_SHADER_RESOURCE 1 << 0
VRG_BIND_RENDER_TARGET 1 << 1
VRG_BIND_DEPTH_STENCIL 1 << 2
VRG_BIND_UNORDERED_ACCESS 1 << 3

See also VrgSwapChainDesc

VrgVrsTextureUpdateFlags

VRS update texture API call flags.

VRG_VRS_UPDATE_NONE 0
VRG_VRS_UPDATE_SIDE_BY_SIDE 1 << 0
VRG_VRS_UPDATE_SIDE_BY_SIDE_FLIPPED 1 << 1

See also vrgVrsTextureUpdate

VrgMrOverlayMode

Mixed reality overlay mode.

VRG_MR_OVERLAY_BACKGROUND 0 Virtual scene (with alpha channel) is rendered over the video stream.
VRG_MR_OVERLAY_MASKED Video stream is rendered over virtual scene. Chroma key masking can be used to mask video.
VRG_MR_OVERLAY_CINEMA Video stream overlay will be rendered in virtual scene at absolute position or relatively to headset.

See also vrgSetMrOverlayMode

VrgMrMaskingType

VRG_MR_MASKING_ALWAYS 0 Video stream is always visible (no masking at all).
VRG_MR_MASKING_CHROMA_KEY Video stream is masked by chroma key settings.
VRG_MR_MASKING_TEXTURE Video stream is masked by texture provided by user.
VRG_MR_MASKING_TEXTURE_CHROMA_KEY_AND Video stream is masked by combination (logical AND) of user provided texture and chroma key settings.
VRG_MR_MASKING_TEXTURE_CHROMA_KEY_XOR Video stream is masked by combination (logical XOR) of user provided texture and chroma key settings.

VrgMrMarkerType

Mixed reality marker detector pattern dictionary.

VRG_MARKER_ARUCO_4X4_50 0
VRG_MARKER_ARUCO_4X4_100
VRG_MARKER_ARUCO_4X4_250
VRG_MARKER_ARUCO_4X4_1000
VRG_MARKER_ARUCO_5X5_50
VRG_MARKER_ARUCO_5X5_100
VRG_MARKER_ARUCO_5X5_250
VRG_MARKER_ARUCO_5X5_1000
VRG_MARKER_ARUCO_6X6_50
VRG_MARKER_ARUCO_6X6_100
VRG_MARKER_ARUCO_6X6_250
VRG_MARKER_ARUCO_6X6_1000
VRG_MARKER_ARUCO_7X7_50
VRG_MARKER_ARUCO_7X7_100
VRG_MARKER_ARUCO_7X7_250
VRG_MARKER_ARUCO_7X7_1000

VrgCameraImage

Structure representing single image returned by vrgAcquireCameraImage.

struct VrgCameraImage {
uint32_t width;
uint32_t height;
double timestamp;
void * data;
VrgImageFormat format;
uint64_t id;
size_t pitch;
}

See also VrgImageFormat

VrgCameraInfo

struct VrgCameraInfo {
uint32_t viewCount;
}

VrgCameraProfile

struct VrgCameraProfile {
uint32_t width;
uint32_t height;
uint32_t fps;
}

VrgControllerData

Structure representing a single controller configuration.

struct VrgControllerData {
VrgVector3 position;
VrgQuaternion orientation;
VrgVector3 velocity;
VrgVector3 angularVelocity;
enum {
   VRG_CONTROLLER_UNINITIALIZED  = 1,
   VRG_CONTROLLER_CALIBRATING_INPROGRESS  = 100,
   VRG_CONTROLLER_CALIBRATING_OUTOFRANGE  = 101,
   VRG_CONTROLLER_RUNNING_OK  = 200,
   VRG_CONTROLLER_RUNNING_OUTOFRANGE  = 201
}
status;
enum {
   VRG_CONTROLLER_ROLE_INVALID  = 0,
   VRG_CONTROLLER_ROLE_LEFT_HAND  = 1,
   VRG_CONTROLLER_ROLE_RIGHT_HAND  = 2
}
role;
uint32_t packetNumber;
uint64_t buttonsPressed;
uint64_t buttonsTouched;
struct Axis {
float x;
float y;
}
axis[5];
uint8_t valid;
uint8_t connected;
}

VrgDevice

Descriptor of a headset device. Id is the main headset identifier used in majority of the VRG API functions.

struct VrgDevice {
uint32_t id;
char name[255];
}

VrgDx12TextureDescriptor

Wrapper structure used as a texture for vrgSubmitFrameLayer() call when using DX12 as a graphics API.

struct VrgDx12TextureDescriptor {
ID3D12Resource * texture;
ID3D12CommandQueue * commandQueue;
uint32_t nodeMask;
}

See also vrgSubmitFrameLayer

VrgDx12VrsTextureUpdate

DX12 specific structure that need to be passed to vrgVrsTextureUpdate API call.

struct VrgDx12VrsTextureUpdate {
ID3D12GraphicsCommandList * commandList;
ID3D12Resource * resource;
D3D12_RESOURCE_STATES resourceStates;
uint32_t flags;
float u;
float v;
float um;
float vm;
}

See also vrgVrsTextureUpdate

VrgFingerBoneData

Structure representing a position and rotation of a bone in 3D right-handed coordinate space.

struct VrgFingerBoneData {
VrgVector3 position;
VrgQuaternion orientation;
float length;
}

VrgFingerData

Structure representing finger bones data for returned by the hand tracking functions.

struct VrgFingerData {
VrgFingerBoneData fingerBones[4];
}

VrgFov

Structure representing field of view (angle tangents).

struct VrgFov {
float leftTan;
float rightTan;
float topTan;
float bottomTan;
}

VrgHandData

Structure representing a position and rotation of a hand at wrist and all its five fingers.

struct VrgHandData {
VrgFingerData fingers[5];
VrgVector3 wristPosition;
VrgQuaternion wristOrientation;
float length;
}

VrgInitInfo

VRG API version.

struct VrgInitInfo {
uint32_t majorVersion;
uint32_t minorVersion;
}

VrgMatrix4

Structure representing transformation matrix in format [row][column].

struct VrgMatrix4 {
float m[4][4];
}

VrgMrMarker

Mixed reality marker detection.

struct VrgMrMarker {
int id;
VrgPose pose;
int numCameras;
}

VrgMrOverlayMasking

Mixed reality chroma key masking.

struct VrgMrOverlayMasking {
VrgMrMaskingType type;
float hsv[3];
float tolerance[3];
}

VrgPose

Structure representing a position and rotation of an object in 3D right-handed coordinate space at particular time.

struct VrgPose {
VrgVector3 position;
VrgQuaternion orientation;
int64_t time;
}

VrgQuaternion

Structure representing a quaternion in 3D right-handed coordinate space.

struct VrgQuaternion {
double x;
double y;
double z;
double w;
}

VrgSwapChain

Opaque swap-chain handle that will be filled when creating a swap-chain.

struct VrgSwapChain {
void * handle;
}

See also vrgCreateSwapChain

VrgSwapChainDesc

Descriptor used for swap-chain creation.

struct VrgSwapChainDesc {
VrgTextureFormat format;
int width;
int height;
int arraySize;
uint32_t bindFlags;
uint32_t textureCount;
}

See also vrgCreateSwapChain

VrgTrackingSystem

Structure representing a single supported tracking system.

struct VrgTrackingSystem {
uint32_t id;
char name[255];
}

VrgVector3

Structure representing a vector in 3D right-handed coordinate space.

struct VrgVector3 {
float x;
float y;
float z;
}

VrgVulkanDeviceDescriptor

Initialization structure to use as a graphics device for vrgAttachGraphicsDevice() call when using Vulkan as a graphics API.

struct VrgVulkanDeviceDescriptor {
VkInstance * instance;
VkPhysicalDevice * physicalDevice;
VkDevice * device;
}

See also vrgAttachGraphicsDevice

VrgVulkanSwapchainSync

Synchronization object to use when using swap chain and Vulkan together.

struct VrgVulkanSwapchainSync {
VkDeviceMemory acquireSync;
uint64_t acquireKey;
uint32_t acquireTimeout;
VkDeviceMemory releaseSync;
uint64_t releaseKey;
}

See also vrgSwapChainCurrentIndexEx

VrgVulkanTextureDescriptor

Wrapper structure used as a texture for vrgSubmitFrameLayer() call when using Vulkan as a graphics API.

struct VrgVulkanTextureDescriptor {
VkImage * texture;
uint16_t width;
uint16_t height;
uint32_t format;
}

See also vrgSubmitFrameLayer

This page was last modified on June 19th, 2023 at 10:50

< PreviousNext >