Pico Native XR SDK
PxrApi.h
Go to the documentation of this file.
1#ifndef PXR_API_H
2#define PXR_API_H
3
4#include "PxrTypes.h"
5
6#if defined(__cplusplus)
7extern "C" {
8#endif
9
10// Preinit
19
29
30// Init and shutdown
51
55
64
68
69// Vulkan
70
75int Pxr_GetDeviceExtensionsVk(const char** extensionNamesArray, uint32_t* extensionCount);
76
81int Pxr_GetInstanceExtensionsVk(const char** extensionNamesArray, uint32_t* extensionCount);
82int Pxr_GetDeviceExtensionsXRPlatform(char** namesString, uint32_t* extensionCount, uint32_t namesCapacityIn);
83int Pxr_GetInstanceExtensionsXRPlatform(char** namesString, uint32_t* extensionCount, uint32_t namesCapacityIn);
84
96int Pxr_CreateVulkanSystem(const PxrVulkanBinding* vulkanBinding);
97
99
100// Create layers
107int Pxr_GetConfigViewsInfos(uint32_t* maxImageRectWidth, uint32_t* maxImageRectHeight, uint32_t* recommendedImageRectWidth, uint32_t* recommendedImageRectHeight);
108
136int Pxr_CreateLayer(const PxrLayerParam* layerParam);
137
148int Pxr_GetLayerImageCount(int layerId, PxrEyeType eye, uint32_t* imageCount);
149
166int Pxr_GetLayerImage(int layerId, PxrEyeType eye, int imageIndex, uint64_t* image);
167
172int Pxr_GetLayerNextImageIndex(int layerId, int* imageIndex);
173
176int Pxr_GetLayerAndroidSurface(int layerId, PxrEyeType eye, jobject* androidSurface);
177int Pxr_GetLayerFoveationImage(int layerId, PxrEyeType eye, uint64_t* foveationImage, uint32_t* width, uint32_t* height);
178
182int Pxr_DestroyLayer(int layerId);
183
184// Begin and end Xr mode
193
197
201
202// Tracking sensor
206int Pxr_GetPredictedDisplayTime(double* predictedDisplayTimeMs);
207
213int Pxr_GetPredictedMainSensorState(double predictTimeMs, PxrSensorState* sensorState, int* sensorFrameIndex);
214
215int Pxr_GetPredictedMainSensorState2(double predictTimeMs, PxrSensorState2* sensorState, int* sensorFrameIndex);
216
222int Pxr_GetPredictedMainSensorStateWithEyePose(double predictTimeMs, PxrSensorState* sensorState, int* sensorFrameIndex, int eyeCount, PxrPosef* eyePoses);
223
235
236// Submit
240
276
280
281// Event
292bool Pxr_PollEvent(int eventCountMAX,int* eventDataCountOutput, PxrEventDataBuffer** eventDataPtr);
293
294// Log print
295void Pxr_LogPrint(int priority, const char * tag, const char * fmt, ...);
296
297// Fov
310int Pxr_GetFov(PxrEyeType eye, float* fovLeft, float* fovRight, float* fovUp, float* fovDown);
311int Pxr_GetFrustum(PxrEyeType eye,float* left, float* right, float* top, float* bottom, float *near, float* far);
312int Pxr_SetFrustum(PxrEyeType eye,float left, float right, float top, float bottom,float near,float far);
313
314// Performance level
317
318// ColorSpace
328
329// FFR
331
345
346// Tracking mode
357
358// Get supported tracking mode
363
364// Eye tracking
389
390// Tracking origin
401
406
407// IPD
411
412// AppFocus
414
415// Configs
449int Pxr_GetConfigInt(PxrConfigType configIndex, int* configData);
450
484int Pxr_GetConfigFloat(PxrConfigType configIndex, float* configData);
485
519int Pxr_SetConfigInt(PxrConfigType configSetIndex, int configSetData);
520int Pxr_SetConfigString(PxrConfigType configIndex, const char* configSetData);
521int Pxr_SetConfigUint64(PxrConfigType configIndex, uint64_t configSetData);
522
524
525bool Pxr_GetIntSysProc(char * command,int* rlt);
526
527// Boundary
528
533int Pxr_GetCameraDataExt(uint8_t** data);
537
553
555int Pxr_SetMonoMode(bool mono);
556
565
574
584
586
595
598
624
643int Pxr_TestPointIsInBoundary(const PxrVector3f* point, bool isPlayArea, PxrBoundaryTriggerInfo* info);
644
656int Pxr_GetBoundaryGeometry(bool isPlayArea, uint32_t pointsCountInput, uint32_t* pointsCountOutput, PxrVector3f* outPoints);
657
668int Pxr_GetBoundaryGeometry2(bool isPlayArea, float ** outPointsFloat, uint32_t *pointsCountOutput);
669
670int Pxr_GetBoundaryDimensions(bool isPlayArea, PxrVector3f* dimension);
671int Pxr_SetSeeThroughImageExtent(uint32_t width, uint32_t height);
672
687
688// Multiview
697bool Pxr_EnableMultiview(bool enable);
698
699// Mrc extended api
701int Pxr_SetMrcPose(const PxrPosef* pose);
703
705int Pxr_SetSensorLostCMST(bool value);
706
711int Pxr_GetDisplayRefreshRatesAvailable(uint32_t* count, float** rateArray);
712
723int Pxr_SetDisplayRefreshRate(float refreshRate);
724
728int Pxr_GetDisplayRefreshRate(float* refreshRate);
729
731#if defined(__cplusplus)
732} // extern "C"
733#endif
734
735#endif // PXR_API_H
int Pxr_GetTrackingOrigin(PxrTrackingOrigin *trackingOrigin)
Gets tracking origin settings.
int Pxr_GetLayerImageCount(int layerId, PxrEyeType eye, uint32_t *imageCount)
Gets the number of images corresponding to a specified layer.
int Pxr_SetTrackingOrigin(PxrTrackingOrigin trackingOrigin)
Sets tracking origin mode.
int Pxr_GetLayerAndroidSurface(int layerId, PxrEyeType eye, jobject *androidSurface)
Gets the Android surface created when the layer is created. Note: This API is available only if the ...
int Pxr_GetLayerFoveationImage(int layerId, PxrEyeType eye, uint64_t *foveationImage, uint32_t *width, uint32_t *height)
bool Pxr_IsRunning()
Checks whether the XR mode has been entered.
int Pxr_GetEyeTrackingData(PxrEyeTrackingData *eyeTrackingData)
Gets the eye tracking data.
int Pxr_PauseGuardianSystemForSTS()
int Pxr_ResumeGuardianSystemForSTS()
int Pxr_GetBoundaryGeometry2(bool isPlayArea, float **outPointsFloat, uint32_t *pointsCountOutput)
Gets the collection of boundary points.
int Pxr_GetDialogState()
Gets the reason why the boundary dialog box appears.
int Pxr_SetTrackingMode(PxrTrackingModeFlags trackingMode)
Sets the tracking mode.
int Pxr_GetConfigFloat(PxrConfigType configIndex, float *configData)
Gets the value of the specified configuration item.
int Pxr_SetInitializeData(PxrInitParamData *params)
Sets the data required for initializing SDK. Note: This API needs to be called before all the other ...
int Pxr_GetPredictedMainSensorState(double predictTimeMs, PxrSensorState *sensorState, int *sensorFrameIndex)
Gets the predicted position and pose of the head.
int Pxr_Shutdown()
Exits and releases resources.
int Pxr_GetInstanceExtensionsVk(const char **extensionNamesArray, uint32_t *extensionCount)
Gets the Vulkan extensions supported by the instance.
int Pxr_GetSeeThroughData(PxrSeeThoughData *data)
Gets the SeeThrough camera image.
int Pxr_GetPredictedMainSensorStateWithEyePose(double predictTimeMs, PxrSensorState *sensorState, int *sensorFrameIndex, int eyeCount, PxrPosef *eyePoses)
Gets the predicted position and pose data of the head, and gets the corresponding eye pose as well.
bool Pxr_GetBoundaryVisible()
Gets whether the boundary is visible.
int Pxr_SetSeeThroughVisible(bool value)
int Pxr_SetMonoMode(bool mono)
int Pxr_CreateVulkanSystem(const PxrVulkanBinding *vulkanBinding)
Inputs Vulkan binding parameters to create a Vulkan session.
int Pxr_GetBoundaryGeometry(bool isPlayArea, uint32_t pointsCountInput, uint32_t *pointsCountOutput, PxrVector3f *outPoints)
Gets the collection of boundary points.
bool Pxr_GetMrcStatus()
int Pxr_SetMrcPose(const PxrPosef *pose)
bool Pxr_GetFeatureSupported(PxrFeatureType feature)
void Pxr_LogPrint(int priority, const char *tag, const char *fmt,...)
int Pxr_GetDeviceExtensionsXRPlatform(char **namesString, uint32_t *extensionCount, uint32_t namesCapacityIn)
int Pxr_GetBoundaryDimensions(bool isPlayArea, PxrVector3f *dimension)
int Pxr_GetTrackingMode(PxrTrackingModeFlags *trackingMode)
Gets the value of tracking mode.
int Pxr_GetInstanceExtensionsXRPlatform(char **namesString, uint32_t *extensionCount, uint32_t namesCapacityIn)
int Pxr_EndFrame()
Ends the current frame and submits all layers submitted by the rendering layer to the compositor laye...
bool Pxr_GetBoundaryConfigured()
Gets whether the boundary has been configured.
int Pxr_Initialize()
Initializes the SDK.
int Pxr_SetBoundaryVisible(bool value)
Sets the boundary as visible or invisible.
int Pxr_ResetSensor(PxrResetSensorOption option)
Resets the pose.
int Pxr_GetCameraDataExt(uint8_t **data)
int Pxr_GetDeviceExtensionsVk(const char **extensionNamesArray, uint32_t *extensionCount)
Gets the Vulkan extensions supported by the device.
int Pxr_GetPerformanceLevels(PxrPerfSettings which, int *level)
PxrFoveationLevel Pxr_GetFoveationLevel()
int Pxr_SetSeeThroughImageExtent(uint32_t width, uint32_t height)
int Pxr_BeginXr()
Enters the XR mode.
int Pxr_SetGraphicOption(PxrGraphicOption graphic)
Sets the type of graphics API.
bool Pxr_GetBoundaryEnabled()
Gets whether the boundary system has been enabled.
int Pxr_SetSeeThroughBackground(bool value)
int Pxr_TestPointIsInBoundary(const PxrVector3f *point, bool isPlayArea, PxrBoundaryTriggerInfo *info)
Checks whether a tracked point in the coordinate system will trigger the boundary.
int Pxr_GetFrustum(PxrEyeType eye, float *left, float *right, float *top, float *bottom, float *near, float *far)
int Pxr_EndXr()
Exits the XR mode.
bool Pxr_SetExtraLatencyMode(int mode)
int Pxr_SetDisplayRefreshRate(float refreshRate)
Sets the display refresh rate.
int Pxr_GetDisplayRefreshRatesAvailable(uint32_t *count, float **rateArray)
Gets the available display refresh rates.
int Pxr_SetFoveationParams(PxrFoveationParams params)
int Pxr_SetConfigUint64(PxrConfigType configIndex, uint64_t configSetData)
int Pxr_StartCameraPreview(int value)
int Pxr_SetGuardianSystemDisable(bool disable)
int Pxr_SetPlatformOption(PxrPlatformOption platform)
Specifies the build platform.
int Pxr_GetRoomModeState()
int Pxr_CreateLayer(const PxrLayerParam *layerParam)
Creates a rendering layer.
int Pxr_SetPerformanceLevels(PxrPerfSettings which, int level)
void Pxr_RegisteKeyEventCallback(void *func)
int Pxr_SubmitLayer(const PxrLayerHeader *layer)
Commits the current rendering layer.
int Pxr_GetPredictedDisplayTime(double *predictedDisplayTimeMs)
Gets the predicted display time of the current rendered frame.
int Pxr_DisableBoundary()
bool Pxr_GetAppHasFocus()
int Pxr_DestroyLayer(int layerId)
Destroies the specified layer.
int Pxr_GetConfigViewsInfos(uint32_t *maxImageRectWidth, uint32_t *maxImageRectHeight, uint32_t *recommendedImageRectWidth, uint32_t *recommendedImageRectHeight)
Gets the maximum and recommended width and height (in pixels) of the Render Buffer.
int Pxr_GetConfigInt(PxrConfigType configIndex, int *configData)
Gets the value of the specified configuration item.
int Pxr_ShutdownSdkGuardianSystem()
int Pxr_GetMrcPose(PxrPosef *pose)
int Pxr_SetConfigInt(PxrConfigType configSetIndex, int configSetData)
Sets the value of the specified configuration item.
int Pxr_SetControllerPoseToBoundary(const PxrPosef *pose, PxrControllerHandness hand, bool valid)
int Pxr_SetConfigString(PxrConfigType configIndex, const char *configSetData)
int Pxr_GetDisplayRefreshRate(float *refreshRate)
Gets the current display refresh rate.
int Pxr_SetSensorLostCMST(bool value)
int Pxr_BeginFrame()
Starts rendering each frame.
int Pxr_StartSdkBoundary()
int Pxr_SetSensorLostCustomMode(bool value)
bool Pxr_GetIntSysProc(char *command, int *rlt)
bool Pxr_IsInitialized()
Gets whether the SDK is initialized.
int Pxr_SetFrustum(PxrEyeType eye, float left, float right, float top, float bottom, float near, float far)
bool Pxr_PollEvent(int eventCountMAX, int *eventDataCountOutput, PxrEventDataBuffer **eventDataPtr)
Gets the latest event.
int Pxr_SetColorSpace(PxrColorSpace colorSpace)
Sets the color space.
bool Pxr_EnableMultiview(bool enable)
Enables/disables Multiview.
float Pxr_GetIPD()
Gets the IPD (interpupillary distance).
int Pxr_GetLayerNextImageIndex(int layerId, int *imageIndex)
Gets the index of the handle of the image to be rendered in the next frame of the layer.
int Pxr_GetFov(PxrEyeType eye, float *fovLeft, float *fovRight, float *fovUp, float *fovDown)
Gets the FOV of the current device.
int Pxr_SetFoveationLevel(PxrFoveationLevel level)
Sets the foveated rendering level.
int Pxr_TestNodeIsInBoundary(PxrBoundaryTestNode node, bool isPlayArea, PxrBoundaryTriggerInfo *info)
Checks whether a tracked node will trigger the boundary.
int Pxr_GetLayerImage(int layerId, PxrEyeType eye, int imageIndex, uint64_t *image)
Gets the handle of a specified image used in a specified layer.
int Pxr_GetPredictedMainSensorState2(double predictTimeMs, PxrSensorState2 *sensorState, int *sensorFrameIndex)
PxrFoveationLevel
Definition: PxrEnums.h:88
PxrResetSensorOption
Definition: PxrEnums.h:138
PxrPlatformOption
Definition: PxrEnums.h:57
PxrControllerHandness
Definition: PxrEnums.h:261
PxrConfigType
Definition: PxrEnums.h:104
PxrPerfSettings
Definition: PxrEnums.h:213
PxrEyeType
Definition: PxrEnums.h:70
PxrFeatureType
Definition: PxrEnums.h:50
PxrColorSpace
Definition: PxrEnums.h:97
PxrBoundaryTestNode
Definition: PxrEnums.h:305
PxrTrackingOrigin
Definition: PxrEnums.h:254
PxrGraphicOption
Definition: PxrEnums.h:64
uint64_t PxrTrackingModeFlags
Definition: PxrTypes.h:17
Definition: PxrTypes.h:307
Definition: PxrTypes.h:163
Definition: PxrTypes.h:94
Definition: PxrTypes.h:300
Definition: PxrTypes.h:293
Definition: PxrTypes.h:119
Definition: PxrTypes.h:31
Definition: PxrTypes.h:68
Definition: PxrTypes.h:315
Definition: PxrTypes.h:83
Definition: PxrTypes.h:73
Definition: PxrTypes.h:55
Definition: PxrTypes.h:22