This website uses cookies to improve our services and deliver relevant ads.
By interacting with this site, you agree to this use. For more information, see our Cookies Policy

Mobile 1.22 Reference Guide

VrApi.h File Reference

Functions

const char *
Returns the version + compile time stamp as a string.
double
Returns global, absolute high-resolution time in seconds.
ovrInitializeStatus
vrapi_Initialize ( const ovrInitParms * initParms )
Initializes the API for application use.
void
Shuts down the API on application exit.
void
vrapi_SetPropertyInt ( const ovrJava * java, const ovrProperty propType, const int intVal )
Returns a VrApi property.
void
vrapi_SetPropertyFloat ( const ovrJava * java, const ovrProperty propType, const float floatVal )
bool
vrapi_GetPropertyInt ( const ovrJava * java, const ovrProperty propType, int * intVal )
Returns false if the property cannot be read.
int
vrapi_GetSystemPropertyInt ( const ovrJava * java, const ovrSystemProperty propType )
Returns a system property.
float
vrapi_GetSystemPropertyFloat ( const ovrJava * java, const ovrSystemProperty propType )
int
vrapi_GetSystemPropertyFloatArray ( const ovrJava * java, const ovrSystemProperty propType, float * values, int numArrayValues )
Returns the number of elements written to values array.
int
vrapi_GetSystemPropertyInt64Array ( const ovrJava * java, const ovrSystemProperty propType, int64_t * values, int numArrayValues )
const char *
vrapi_GetSystemPropertyString ( const ovrJava * java, const ovrSystemProperty propType )
The return memory is guaranteed to be valid until the next call to vrapi_GetSystemPropertyString.
int
vrapi_GetSystemStatusInt ( const ovrJava * java, const ovrSystemStatus statusType )
Returns a system status.
float
vrapi_GetSystemStatusFloat ( const ovrJava * java, const ovrSystemStatus statusType )
ovrMobile *
vrapi_EnterVrMode ( const ovrModeParms * parms )
Starts up the time warp, V-sync tracking, sensor reading, clock locking, thread scheduling, and sets video options.
void
Shut everything down for window destruction or when the activity is paused.
double
vrapi_GetPredictedDisplayTime ( ovrMobile * ovr, long long frameIndex )
Returns a predicted absolute system time in seconds at which the next set of eye images will be displayed.
ovrTracking2
vrapi_GetPredictedTracking2 ( ovrMobile * ovr, double absTimeInSeconds )
Returns the predicted sensor state based on the specified absolute system time in seconds.
ovrTracking
vrapi_GetPredictedTracking ( ovrMobile * ovr, double absTimeInSeconds )
OVR_VRAPI_DEPRECATED ( void vrapi_RecenterPose )
Recenters the orientation on the yaw axis and will recenter the position when position tracking is available.
OVR_VRAPI_DEPRECATED ( ovrPosef vrapi_GetTrackingTransform )
The coordinate system used by the tracking system is defined in meters with its positive y axis pointing up, but its origin and yaw are unspecified.
OVR_VRAPI_DEPRECATED ( void vrapi_SetTrackingTransform )
Sets the transform used convert between tracking coordinates and a canonical application-defined space.
ovrTrackingSpace
Returns the current tracking space.
ovrResult
Set the tracking space.
ovrPosef
Returns pose of the requested space relative to the current space.
ovrResult
vrapi_GetBoundaryGeometry ( ovrMobile * ovr, const uint32_t pointsCountInput, uint32_t * pointsCountOutput, ovrVector3f * points )
Get the geometry of the Guardian System as a list of points that define the outer boundary space.
ovrResult
Gets the dimension of the Oriented Bounding box for the Guardian System.
ovrResult
vrapi_TestPointIsInBoundary ( ovrMobile * ovr, const ovrVector3f point, bool * pointInsideBoundary, ovrBoundaryTriggerResult * result )
Tests collision/proximity of a 3D point against the Guardian System Boundary and returns whether or not a given point is inside or outside of the boundary.
ovrResult
Tests collision/proximity of position tracked devices (e.g.
ovrResult
vrapi_RequestBoundaryVisible ( ovrMobile * ovr, const bool visible )
Used to force Guardian System mesh visibility to true.
ovrResult
vrapi_GetBoundaryVisible ( ovrMobile * ovr, bool * visible )
Used to access whether or not the Guardian System is visible or not.
ovrTextureSwapChain *
vrapi_CreateTextureSwapChain3 ( ovrTextureType type, int64_t format, int width, int height, int levels, int bufferCount )
Texture Swap Chain lifetime is explicitly controlled by the application via calls to vrapi_CreateTextureSwapChain* or vrapi_CreateAndroidSurfaceSwapChain and vrapi_DestroyTextureSwapChain.
ovrTextureSwapChain *
vrapi_CreateTextureSwapChain2 ( ovrTextureType type, ovrTextureFormat format, int width, int height, int levels, int bufferCount )
ovrTextureSwapChain *
vrapi_CreateTextureSwapChain ( ovrTextureType type, ovrTextureFormat format, int width, int height, int levels, bool buffered )
ovrTextureSwapChain *
vrapi_CreateAndroidSurfaceSwapChain ( int width, int height )
Create an Android SurfaceTexture based texture swap chain suitable for use with vrapi_SubmitFrame.
void
Destroy the given texture swap chain.
int
Returns the number of textures in the swap chain.
unsigned int
Get the OpenGL name of the texture at the given index.
jobject
Get the Android Surface object associated with the swap chain.
void
vrapi_SubmitFrame ( ovrMobile * ovr, const ovrFrameParms * parms )
Accepts new eye images plus poses that will be used for future warps.
ovrResult
vrapi_SubmitFrame2 ( ovrMobile * ovr, const ovrSubmitFrameDescription2 * frameDescription )
vrapi_SubmitFrame2 takes a frameDescription describing per-frame information such as: a flexible list of layers which should be drawn this frame and a frame index.
ovrResult
vrapi_SetClockLevels ( ovrMobile * ovr, const int32_t cpuLevel, const int32_t gpuLevel )
Set the CPU and GPU performance levels.
ovrResult
vrapi_SetPerfThread ( ovrMobile * ovr, const ovrPerfThreadType type, const uint32_t threadId )
Specify which app threads should be given higher scheduling priority.
ovrResult
If VRAPI_EXTRA_LATENCY_MODE_ON specified, adds an extra frame of latency for full GPU utilization.
ovrResult
vrapi_SetDisplayRefreshRate ( ovrMobile * ovr, const float refreshRate )
Set the Display Refresh Rate.

Function Documentation

OVR_VRAPI_EXPORT const char* vrapi_GetVersionString ( )
Returns the version + compile time stamp as a string.
Can be called any time from any thread.
OVR_VRAPI_EXPORT double vrapi_GetTimeInSeconds ( )
Returns global, absolute high-resolution time in seconds.
This is the same value as used in sensor messages and on Android also the same as Java's system.nanoTime(), which is what the Choreographer V-sync timestamp is based on.
Do not use this time as a seed for simulations, animations or other logic. An animation, for instance, should not be updated based on the "real time" the animation code is executed. Instead, an animation should be updated based on the time it will be displayed. Using the "real time" will introduce intra-frame motion judder when the code is not executed at a consistent point in time every frame. In other words, for simulations, animations and other logic use the time returned by vrapi_GetPredictedDisplayTime(). Can be called any time from any thread.
OVR_VRAPI_EXPORT ovrInitializeStatus vrapi_Initialize ( const ovrInitParms * initParms )
Initializes the API for application use.
This is lightweight and does not create any threads. This is typically called from onCreate() or shortly thereafter. Can be called from any thread. Returns a non-zero value from ovrInitializeStatus on error.
OVR_VRAPI_EXPORT void vrapi_Shutdown ( )
Shuts down the API on application exit.
This is typically called from onDestroy() or shortly thereafter. Can be called from any thread.
OVR_VRAPI_EXPORT void vrapi_SetPropertyInt ( const ovrJava * java, const ovrProperty propType, const int intVal )
Returns a VrApi property.
These functions can be called any time from any thread once the VrApi is initialized.
OVR_VRAPI_EXPORT void vrapi_SetPropertyFloat ( const ovrJava * java, const ovrProperty propType, const float floatVal )
OVR_VRAPI_EXPORT bool vrapi_GetPropertyInt ( const ovrJava * java, const ovrProperty propType, int * intVal )
Returns false if the property cannot be read.
OVR_VRAPI_EXPORT int vrapi_GetSystemPropertyInt ( const ovrJava * java, const ovrSystemProperty propType )
Returns a system property.
These are constants for a particular device. These functions can be called any time from any thread once the VrApi is initialized.
OVR_VRAPI_EXPORT float vrapi_GetSystemPropertyFloat ( const ovrJava * java, const ovrSystemProperty propType )
OVR_VRAPI_EXPORT int vrapi_GetSystemPropertyFloatArray ( const ovrJava * java, const ovrSystemProperty propType, float * values, int numArrayValues )
Returns the number of elements written to values array.
OVR_VRAPI_EXPORT int vrapi_GetSystemPropertyInt64Array ( const ovrJava * java, const ovrSystemProperty propType, int64_t * values, int numArrayValues )
OVR_VRAPI_EXPORT const char* vrapi_GetSystemPropertyString ( const ovrJava * java, const ovrSystemProperty propType )
The return memory is guaranteed to be valid until the next call to vrapi_GetSystemPropertyString.
OVR_VRAPI_EXPORT int vrapi_GetSystemStatusInt ( const ovrJava * java, const ovrSystemStatus statusType )
Returns a system status.
These are variables that may change at run-time. This function can be called any time from any thread once the VrApi is initialized.
OVR_VRAPI_EXPORT float vrapi_GetSystemStatusFloat ( const ovrJava * java, const ovrSystemStatus statusType )
OVR_VRAPI_EXPORT ovrMobile* vrapi_EnterVrMode ( const ovrModeParms * parms )
Starts up the time warp, V-sync tracking, sensor reading, clock locking, thread scheduling, and sets video options.
The parms are copied, and are not referenced after the function returns.
This should be called after vrapi_Initialize(), when the app is both resumed and has a valid window surface (ANativeWindow).
On Android, an application cannot just allocate a new window surface and render to it. Android allocates and manages the window surface and (after the fact) notifies the application of the state of affairs through life cycle events (surfaceCreated / surfaceChanged / surfaceDestroyed). The application (or 3rd party engine) typically handles these events. Since the VrApi cannot just allocate a new window surface, and the VrApi does not handle the life cycle events, the VrApi somehow has to take over ownership of the Android surface from the application. To allow this, the application can explicitly pass the EGLDisplay, EGLContext and EGLSurface or ANativeWindow to vrapi_EnterVrMode(). The EGLDisplay and EGLContext are used to create a shared context used by the background time warp thread.
If, however, the application does not explicitly pass in these objects, then vrapi_EnterVrMode() must be called from a thread with an OpenGL ES context current on the Android window surface. The context of the calling thread is then used to match the version and config for the context used by the background time warp thread. The time warp will also hijack the Android window surface from the context that is current on the calling thread. On return, the context from the calling thread will be current on an invisible pbuffer, because the time warp takes ownership of the Android window surface. Note that this requires the config used by the calling thread to have an EGL_SURFACE_TYPE with EGL_PBUFFER_BIT.
New applications must always explicitly pass in the EGLDisplay, EGLContext and ANativeWindow, otherwise vrapi_EnterVrMode will fail.
This function will return NULL when entering VR mode failed because the ANativeWindow was not valid. If the ANativeWindow's buffer queue is abandoned ("BufferQueueProducer: BufferQueue has been abandoned"), then the app can wait for a new ANativeWindow (through SurfaceCreated). If another API is already connected to the ANativeWindow ("BufferQueueProducer: already connected"), then the app has to first disconnect whatever is connected to the ANativeWindow (typically an EGLSurface).
OVR_VRAPI_EXPORT void vrapi_LeaveVrMode ( ovrMobile * ovr )
Shut everything down for window destruction or when the activity is paused.
The ovrMobile object is freed by this function.
Must be called from the same thread that called vrapi_EnterVrMode(). If the application did not explicitly pass in the Android window surface, then this thread must have the same OpenGL ES context that was current on the Android window surface before calling vrapi_EnterVrMode(). By calling this function, the time warp gives up ownership of the Android window surface, and on return, the context from the calling thread will be current again on the Android window surface.
OVR_VRAPI_EXPORT double vrapi_GetPredictedDisplayTime ( ovrMobile * ovr, long long frameIndex )
Returns a predicted absolute system time in seconds at which the next set of eye images will be displayed.
The predicted time is the middle of the time period during which the new eye images will be displayed. The number of frames predicted ahead depends on the pipeline depth of the engine and the minumum number of V-syncs in between eye image rendering. The better the prediction, the less black will be pulled in at the edges by the time warp.
The frameIndex is an application controlled number that uniquely identifies the new set of eye images for which synthesis is about to start. This same frameIndex must be passed to vrapi_SubmitFrame() when the new eye images are submitted to the time warp. The frameIndex is expected to be incremented once every frame before calling this function.
Can be called from any thread while in VR mode.
OVR_VRAPI_EXPORT ovrTracking2 vrapi_GetPredictedTracking2 ( ovrMobile * ovr, double absTimeInSeconds )
Returns the predicted sensor state based on the specified absolute system time in seconds.
Pass absTime value of 0.0 to request the most recent sensor reading.
Can be called from any thread while in VR mode.
OVR_VRAPI_EXPORT ovrTracking vrapi_GetPredictedTracking ( ovrMobile * ovr, double absTimeInSeconds )
OVR_VRAPI_DEPRECATED ( void vrapi_RecenterPose )
Recenters the orientation on the yaw axis and will recenter the position when position tracking is available.
Note:
This immediately affects vrapi_GetPredictedTracking() which may be called asynchronously from the time warp. It is therefore best to make sure the screen is black before recentering to avoid previous eye images from being abrubtly warped across the screen.
Can be called from any thread while in VR mode.
OVR_VRAPI_DEPRECATED ( ovrPosef vrapi_GetTrackingTransform )
The coordinate system used by the tracking system is defined in meters with its positive y axis pointing up, but its origin and yaw are unspecified.
Applications generally prefer to operate in a well-defined coordinate system relative to some base pose. The tracking transform allows the application to specify the space that tracking poses are reported in.
The tracking transform is specified as the ovrPosef of the base pose in tracking system coordinates.
Head poses the application supplies in vrapi_SubmitFrame() are transformed by the tracking transform. Pose predictions generated by the system are transformed by the inverse of the tracking transform before being reported to the application.
Note:
This immediately affects vrapi_SubmitFrame() and vrapi_GetPredictedTracking(). It is important for the app to make sure that the tracking transform does not change between the fetching of a pose prediction and the submission of poses in vrapi_SubmitFrame().
The default Tracking Transform is VRAPI_TRACKING_TRANSFORM_SYSTEM_CENTER_EYE_LEVEL. Returns a pose suitable to use as a tracking transform. Applications that want to use an eye-level based coordinate system can fetch the VRAPI_TRACKING_TRANSFORM_SYSTEM_CENTER_EYE_LEVEL transform. Applications that want to use a floor-level based coordinate system can fetch the VRAPI_TRACKING_TRANSFORM_SYSTEM_CENTER_FLOOR_LEVEL transform. To determine the current tracking transform, applications can fetch the VRAPI_TRACKING_TRANSFORM_CURRENT transform. The TrackingTransform API has been deprecated because it was superceded by the TrackingSpace API. The key difference in the TrackingSpace API is that LOCAL and LOCAL_FLOOR spaces are mutable, so user/system recentering is transparently applied without app intervention.
OVR_VRAPI_DEPRECATED ( void vrapi_SetTrackingTransform )
Sets the transform used convert between tracking coordinates and a canonical application-defined space.
Only the yaw component of the orientation is used.
OVR_VRAPI_EXPORT ovrTrackingSpace vrapi_GetTrackingSpace ( ovrMobile * ovr )
Returns the current tracking space.
OVR_VRAPI_EXPORT ovrResult vrapi_SetTrackingSpace ( ovrMobile * ovr, ovrTrackingSpace whichSpace )
Set the tracking space.
There are currently two options:
  • VRAPI_TRACKING_SPACE_LOCAL (default) The local tracking space's origin is at the nominal head position with +y up, and -z forward. This space is volatile and will change when system recentering occurs.
  • VRAPI_TRACKING_SPACE_LOCAL_FLOOR The local floor tracking space is the same as the local tracking space, except its origin is translated down to the floor. The local floor space differs from the local space only in its y translation. This space is volatile and will change when system recentering occurs.
OVR_VRAPI_EXPORT ovrPosef vrapi_LocateTrackingSpace ( ovrMobile * ovr, ovrTrackingSpace target )
Returns pose of the requested space relative to the current space.
The returned value is not affected by the current tracking transform.
OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryGeometry ( ovrMobile * ovr, const uint32_t pointsCountInput, uint32_t * pointsCountOutput, ovrVector3f * points )
Get the geometry of the Guardian System as a list of points that define the outer boundary space.
You can choose to get just the number of points by passing in a null value for points or by passing in a pointsCountInput size of 0. Otherwise pointsCountInput will be used to fetch as many points as possible from the Guardian points data. If the input size exceeds the number of points that are currently stored off we only copy up to the number of points that we have and pointsCountOutput will return the number of copied points
OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryOrientedBoundingBox ( ovrMobile * ovr, ovrPosef * pose, ovrVector3f * scale )
Gets the dimension of the Oriented Bounding box for the Guardian System.
This is the largest fit rectangle within the Guardian System boundary geometry. The pose value contains the forward facing direction as well as the translation for the oriented box. The scale return value returns a scalar value for the width, height, and depth of the box. These values are half the actual size as they are scalars and in meters."
OVR_VRAPI_EXPORT ovrResult vrapi_TestPointIsInBoundary ( ovrMobile * ovr, const ovrVector3f point, bool * pointInsideBoundary, ovrBoundaryTriggerResult * result )
Tests collision/proximity of a 3D point against the Guardian System Boundary and returns whether or not a given point is inside or outside of the boundary.
If a more detailed set of boundary trigger information is requested a ovrBoundaryTriggerResult may be passed in. However null may also be passed in to just return whether a point is inside the boundary or not.
OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryTriggerState ( ovrMobile * ovr, const ovrTrackedDeviceTypeId deviceId, ovrBoundaryTriggerResult * result )
Tests collision/proximity of position tracked devices (e.g.
HMD and/or Controllers) against the Guardian System boundary. This function returns an ovrGuardianTriggerResult which contains information such as distance and closest point based on collision/proximity test
OVR_VRAPI_EXPORT ovrResult vrapi_RequestBoundaryVisible ( ovrMobile * ovr, const bool visible )
Used to force Guardian System mesh visibility to true.
Forcing to false will set the Guardian System back to normal operation.
OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryVisible ( ovrMobile * ovr, bool * visible )
Used to access whether or not the Guardian System is visible or not.
OVR_VRAPI_EXPORT ovrTextureSwapChain* vrapi_CreateTextureSwapChain3 ( ovrTextureType type, int64_t format, int width, int height, int levels, int bufferCount )
Texture Swap Chain lifetime is explicitly controlled by the application via calls to vrapi_CreateTextureSwapChain* or vrapi_CreateAndroidSurfaceSwapChain and vrapi_DestroyTextureSwapChain.
Swap Chains are associated with the VrApi instance, not the VrApi ovrMobile. Therefore, calls to vrapi_EnterVrMode and vrapi_LeaveVrMode will not destroy or cause the Swap Chain to become invalid. Create a texture swap chain that can be passed to vrapi_SubmitFrame. Must be called from a thread with a valid OpenGL ES context current.
'bufferCount' used to be a bool that selected either a single texture index or a triple buffered index, but the new entry point vrapi_CreateTextureSwapChain2, allows up to 16 buffers to be allocated, which is useful for maintaining a deep video buffer queue to get better frame timing.
'format' used to be an ovrTextureFormat but has been expanded to accept platform specific format types. For GLES, this is the internal format. If an unsupported format is provided, swapchain creation will fail.
SwapChain creation failures result in a return value of 'nullptr'.
OVR_VRAPI_EXPORT ovrTextureSwapChain* vrapi_CreateTextureSwapChain2 ( ovrTextureType type, ovrTextureFormat format, int width, int height, int levels, int bufferCount )
OVR_VRAPI_EXPORT ovrTextureSwapChain* vrapi_CreateTextureSwapChain ( ovrTextureType type, ovrTextureFormat format, int width, int height, int levels, bool buffered )
OVR_VRAPI_EXPORT ovrTextureSwapChain* vrapi_CreateAndroidSurfaceSwapChain ( int width, int height )
Create an Android SurfaceTexture based texture swap chain suitable for use with vrapi_SubmitFrame.
Updating of the SurfaceTexture is handled through normal Android platform specific mechanisms from within the Compositor. A reference to the Android Surface object associated with the SurfaceTexture may be obtained by calling vrapi_GetTextureSwapChainAndroidSurface.
An optional width and height (ie width and height do not equal zero) may be provided in order to set the default size of the image buffers. Note that the image producer may override the buffer size, in which case the default values provided here will not be used (ie both video decompression or camera preview override the size automatically).
OVR_VRAPI_EXPORT void vrapi_DestroyTextureSwapChain ( ovrTextureSwapChain * chain )
Destroy the given texture swap chain.
Must be called from a thread with the same OpenGL ES context current when vrapi_CreateTextureSwapChain was called.
OVR_VRAPI_EXPORT int vrapi_GetTextureSwapChainLength ( ovrTextureSwapChain * chain )
Returns the number of textures in the swap chain.
OVR_VRAPI_EXPORT unsigned int vrapi_GetTextureSwapChainHandle ( ovrTextureSwapChain * chain, int index )
Get the OpenGL name of the texture at the given index.
OVR_VRAPI_EXPORT jobject vrapi_GetTextureSwapChainAndroidSurface ( ovrTextureSwapChain * chain )
Get the Android Surface object associated with the swap chain.
OVR_VRAPI_EXPORT void vrapi_SubmitFrame ( ovrMobile * ovr, const ovrFrameParms * parms )
Accepts new eye images plus poses that will be used for future warps.
The parms are copied, and are not referenced after the function returns.
This will block until the textures from the previous vrapi_SubmitFrame() have been consumed by the background thread, to allow one frame of overlap for maximum GPU utilization, while preventing multiple frames from piling up variable latency.
This will block until at least SwapInterval vsyncs have passed since the last call to vrapi_SubmitFrame() to prevent applications with simple scenes from generating completely wasted frames.
IMPORTANT: any dynamic textures that are passed to vrapi_SubmitFrame() must be triple buffered to avoid flickering and performance problems.
The VrApi allows for one frame of overlap which is essential on tiled mobile GPUs. Because there is one frame of overlap, the eye images have typically not completed rendering by the time they are submitted to vrapi_SubmitFrame(). To allow the time warp to check whether the eye images have completed rendering, vrapi_SubmitFrame() adds a sync object to the current context. Therefore, vrapi_SubmitFrame() must be called from a thread with an OpenGL ES context whose completion ensures that frame rendering is complete. Generally this is the thread and context that was used for the rendering.
OVR_VRAPI_EXPORT ovrResult vrapi_SubmitFrame2 ( ovrMobile * ovr, const ovrSubmitFrameDescription2 * frameDescription )
vrapi_SubmitFrame2 takes a frameDescription describing per-frame information such as: a flexible list of layers which should be drawn this frame and a frame index.
OVR_VRAPI_EXPORT ovrResult vrapi_SetClockLevels ( ovrMobile * ovr, const int32_t cpuLevel, const int32_t gpuLevel )
Set the CPU and GPU performance levels.
Increasing the levels increases performance at the cost of higher power consumption which likely leads to a greater chance of overheating.
Levels will be clamped to the expected range. Default clock levels are cpuLevel = 2, gpuLevel = 2.
OVR_VRAPI_EXPORT ovrResult vrapi_SetPerfThread ( ovrMobile * ovr, const ovrPerfThreadType type, const uint32_t threadId )
Specify which app threads should be given higher scheduling priority.
OVR_VRAPI_EXPORT ovrResult vrapi_SetExtraLatencyMode ( ovrMobile * ovr, const ovrExtraLatencyMode mode )
If VRAPI_EXTRA_LATENCY_MODE_ON specified, adds an extra frame of latency for full GPU utilization.
Default is VRAPI_EXTRA_LATENCY_MODE_OFF.
The latency mode specified will be applied on the next call to vrapi_SubmitFrame(2).
OVR_VRAPI_EXPORT ovrResult vrapi_SetDisplayRefreshRate ( ovrMobile * ovr, const float refreshRate )
Set the Display Refresh Rate.
Returns ovrSuccess or an ovrError code. Returns 'ovrError_InvalidParameter' if requested refresh rate is not supported by the device. Returns 'ovrError_InvalidOperation' if setting the display refresh rate was not successful (such as when the device is in low power mode).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
417
418
419
420
423
424
436
437
438
439
440
441
447
448
452
453
454
455
456
457
460
461
462
464
465
466
467
468
469
472
473
475
476
477
478
479
481
482
483
484
485
486
489
490
491
492
493
494
495
534
535
546
547
548
549
550
551
568
569
574
575
576
577
587
588
589
590
591
592
593
594
595
596
597
619
627
632
633
637
638
639
641
642
653
654
657
658
659
660
661
662
663
670
671
677
678
683
684
688
689
692
693
695
696
697
698
699
700
701
707
721
722
723
724
725
726
727
728
729
739
740
741
744
745
747
748
750
751
752
754
755
756
757
758
759
782
783
786
787
788
789
790
791
798
799
801
802
807
808
809
810
811
812
817
818
819
820
821
822
823
824
825
826
/************************************************************************************

Filename    :   VrApi.h
Content     :   Minimum necessary API for mobile VR
Created     :   June 25, 2014
Authors     :   John Carmack, J.M.P. van Waveren
Language    :   C99

Copyright   :   Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.

*************************************************************************************/
#ifndef OVR_VrApi_h
#define OVR_VrApi_h

#include "VrApi_Config.h"
#include "VrApi_Version.h"
#include "VrApi_Types.h"

#if defined( __cplusplus )
extern"C" {
#endif

OVR_VRAPI_EXPORT constchar * vrapi_GetVersionString();

OVR_VRAPI_EXPORT double vrapi_GetTimeInSeconds();

//-----------------------------------------------------------------
// Initialization/Shutdown
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT ovrInitializeStatus vrapi_Initialize( const ovrInitParms * initParms );

OVR_VRAPI_EXPORT void vrapi_Shutdown();

//-----------------------------------------------------------------
// VrApi Properties
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT void vrapi_SetPropertyInt( const ovrJava * java, const ovrProperty propType, constint intVal );
OVR_VRAPI_EXPORT void vrapi_SetPropertyFloat( const ovrJava * java, const ovrProperty propType, constfloat floatVal );

OVR_VRAPI_EXPORT bool vrapi_GetPropertyInt( const ovrJava * java, const ovrProperty propType, int * intVal );

//-----------------------------------------------------------------
// System Properties
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT int vrapi_GetSystemPropertyInt( const ovrJava * java, const ovrSystemProperty propType );
OVR_VRAPI_EXPORT float vrapi_GetSystemPropertyFloat( const ovrJava * java, const ovrSystemProperty propType );
OVR_VRAPI_EXPORT int vrapi_GetSystemPropertyFloatArray( const ovrJava * java, const ovrSystemProperty propType,
float * values, int numArrayValues );
OVR_VRAPI_EXPORT int vrapi_GetSystemPropertyInt64Array( const ovrJava * java, const ovrSystemProperty propType,
                                                        int64_t * values, int numArrayValues );

OVR_VRAPI_EXPORT constchar * vrapi_GetSystemPropertyString( const ovrJava * java, const ovrSystemProperty propType );

//-----------------------------------------------------------------
// System Status
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT int vrapi_GetSystemStatusInt( const ovrJava * java, const ovrSystemStatus statusType );
OVR_VRAPI_EXPORT float vrapi_GetSystemStatusFloat( const ovrJava * java, const ovrSystemStatus statusType );

//-----------------------------------------------------------------
// Enter/Leave VR mode
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT ovrMobile * vrapi_EnterVrMode( const ovrModeParms * parms );

OVR_VRAPI_EXPORT void vrapi_LeaveVrMode( ovrMobile * ovr );

//-----------------------------------------------------------------
// Tracking
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT double vrapi_GetPredictedDisplayTime( ovrMobile * ovr, longlong frameIndex );

OVR_VRAPI_EXPORT ovrTracking2 vrapi_GetPredictedTracking2( ovrMobile * ovr, double absTimeInSeconds );

OVR_VRAPI_EXPORT ovrTracking vrapi_GetPredictedTracking( ovrMobile * ovr, double absTimeInSeconds );


// vrapi_RecenterPose() is being deprecated because it is supported at the user
// level via system interaction, and at the app level, the app is free to use
// any means it likes to control the mapping of virtual space to physical space.
OVR_VRAPI_DEPRECATED( OVR_VRAPI_EXPORT void vrapi_RecenterPose( ovrMobile * ovr ) );

//-----------------------------------------------------------------
// Tracking Transform
//
//-----------------------------------------------------------------



OVR_VRAPI_DEPRECATED( OVR_VRAPI_EXPORT ovrPosef  vrapi_GetTrackingTransform( ovrMobile * ovr, ovrTrackingTransform whichTransform ) );

OVR_VRAPI_DEPRECATED( OVR_VRAPI_EXPORT void vrapi_SetTrackingTransform( ovrMobile * ovr, ovrPosef pose ) );


OVR_VRAPI_EXPORT ovrTrackingSpace vrapi_GetTrackingSpace( ovrMobile * ovr );

OVR_VRAPI_EXPORT ovrResult vrapi_SetTrackingSpace( ovrMobile * ovr, ovrTrackingSpace whichSpace );

OVR_VRAPI_EXPORT ovrPosef vrapi_LocateTrackingSpace( ovrMobile * ovr, ovrTrackingSpace target );

//-----------------------------------------------------------------
// Guardian System
//
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryGeometry( ovrMobile * ovr, const uint32_t pointsCountInput, uint32_t * pointsCountOutput, ovrVector3f * points );

OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryOrientedBoundingBox( ovrMobile * ovr, ovrPosef * pose, ovrVector3f * scale );

OVR_VRAPI_EXPORT ovrResult vrapi_TestPointIsInBoundary( ovrMobile * ovr, const ovrVector3f point, bool * pointInsideBoundary, ovrBoundaryTriggerResult * result );

OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryTriggerState( ovrMobile * ovr, const ovrTrackedDeviceTypeId deviceId, ovrBoundaryTriggerResult * result );

OVR_VRAPI_EXPORT ovrResult vrapi_RequestBoundaryVisible( ovrMobile * ovr, constbool visible );

OVR_VRAPI_EXPORT ovrResult vrapi_GetBoundaryVisible( ovrMobile * ovr, bool * visible );

//-----------------------------------------------------------------
// Texture Swap Chains
//
//-----------------------------------------------------------------


OVR_VRAPI_EXPORT ovrTextureSwapChain * vrapi_CreateTextureSwapChain3( ovrTextureType type, int64_t format,
int width, int height, int levels, int bufferCount );

OVR_VRAPI_EXPORT ovrTextureSwapChain * vrapi_CreateTextureSwapChain2( ovrTextureType type, ovrTextureFormat format,
int width, int height, int levels, int bufferCount );

OVR_VRAPI_EXPORT ovrTextureSwapChain * vrapi_CreateTextureSwapChain( ovrTextureType type, ovrTextureFormat format,
int width, int height, int levels, bool buffered );

OVR_VRAPI_EXPORT ovrTextureSwapChain * vrapi_CreateAndroidSurfaceSwapChain( int width, int height );


OVR_VRAPI_EXPORT void vrapi_DestroyTextureSwapChain( ovrTextureSwapChain * chain );

OVR_VRAPI_EXPORT int vrapi_GetTextureSwapChainLength( ovrTextureSwapChain * chain );

OVR_VRAPI_EXPORT unsignedint vrapi_GetTextureSwapChainHandle( ovrTextureSwapChain * chain, int index );


OVR_VRAPI_EXPORT jobject vrapi_GetTextureSwapChainAndroidSurface( ovrTextureSwapChain * chain );

//-----------------------------------------------------------------
// Frame Submission
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT void vrapi_SubmitFrame( ovrMobile * ovr, const ovrFrameParms * parms );

OVR_VRAPI_EXPORT ovrResult vrapi_SubmitFrame2( ovrMobile * ovr, const ovrSubmitFrameDescription2 * frameDescription );

//-----------------------------------------------------------------
// Performance
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT ovrResult vrapi_SetClockLevels( ovrMobile * ovr, const int32_t cpuLevel, const int32_t gpuLevel );

OVR_VRAPI_EXPORT ovrResult vrapi_SetPerfThread( ovrMobile * ovr, const ovrPerfThreadType type, const uint32_t threadId );

OVR_VRAPI_EXPORT ovrResult vrapi_SetExtraLatencyMode( ovrMobile * ovr, const ovrExtraLatencyMode mode );

//-----------------------------------------------------------------
// Display Refresh Rate
//-----------------------------------------------------------------

OVR_VRAPI_EXPORT ovrResult vrapi_SetDisplayRefreshRate( ovrMobile * ovr, constfloat refreshRate );




#if defined( __cplusplus )
}   // extern "C"
#endif

#endif  // OVR_VrApi_h
The documentation for this file was generated from the following file: Include/VrApi.h