Go to the source code of this file.
Functions | |
varjo_Bool | varjo_IsAvailable () |
Checks whether Varjo system is available. More... | |
const char * | varjo_GetVersionString () |
Gets the short version of the runtime. More... | |
const uint64_t | varjo_GetVersion () |
Gets the version number of the runtime. More... | |
struct varjo_Session * | varjo_SessionInit (void) |
Initializes a Varjo client session. More... | |
void | varjo_SessionShutDown (struct varjo_Session *session) |
Shuts down a session and releases all the resources internally allocated by Varjo session. More... | |
void | varjo_SessionSetPriority (struct varjo_Session *session, int32_t priority) |
Sets session overlay priority. More... | |
varjo_Nanoseconds | varjo_GetCurrentTime (struct varjo_Session *session) |
Gets the current time in a format that Varjo API uses. More... | |
struct varjo_FrameInfo * | varjo_CreateFrameInfo (struct varjo_Session *session) |
Creates a frame info with initial values. More... | |
void | varjo_FreeFrameInfo (struct varjo_FrameInfo *frameInfo) |
Frees an allocated frame info. More... | |
void | varjo_SetCenteredProjection (struct varjo_Session *session, varjo_Bool enabled) |
Forces the provided projection matrices to be centered. More... | |
int32_t | varjo_GetViewCount (struct varjo_Session *session) |
Gets numbers of views. More... | |
struct varjo_AlignedView | varjo_GetAlignedView (double *projectionMatrix) |
Gets an aligned view from a projection matrix. More... | |
void | varjo_WaitSync (struct varjo_Session *session, struct varjo_FrameInfo *frameInfo) |
Called at the start of a frame. More... | |
varjo_Nanoseconds | varjo_FrameGetDisplayTime (struct varjo_Session *session) |
Gets the time when the frame is scheduled to be displayed. More... | |
struct varjo_Matrix | varjo_FrameGetPose (struct varjo_Session *session, varjo_PoseType type) |
Gets a pose for the current frame. More... | |
struct varjo_Matrix | varjo_GetTrackingToLocalTransform (struct varjo_Session *session) |
Transform from tracking space to local client space. More... | |
struct varjo_Matrix | varjo_GetRelativePoseTransform (struct varjo_Session *session, varjo_PoseType src, varjo_PoseType dest) |
Gets a relative transformation from source pose to destination pose. More... | |
struct varjo_Matrix | varjo_ApplyTransform (struct varjo_Session *session, struct varjo_Matrix *m1, struct varjo_Matrix *m2) |
Applies transform using post multiplication. More... | |
void | varjo_ResetPose (struct varjo_Session *session, varjo_Bool position, varjo_RotationReset rotation) |
Resets pose tracking origin. More... | |
struct varjo_ViewDescription | varjo_GetViewDescription (struct varjo_Session *session, int32_t viewIndex) |
Gets the display information for a given view. More... | |
struct varjo_Mesh2Df * | varjo_CreateOcclusionMesh (struct varjo_Session *session, int32_t viewIndex, varjo_WindingOrder windingOrder) |
Creates the occlusion mesh for a given view index. More... | |
void | varjo_FreeOcclusionMesh (struct varjo_Mesh2Df *mesh) |
Frees the memory allocated by varjo_CreateOcclusionMesh. More... | |
varjo_Error | varjo_GetError (struct varjo_Session *session) |
Gets the latest error code. More... | |
const char * | varjo_GetErrorDesc (varjo_Error error) |
Gets error description for the specified error code. More... | |
void | varjo_GazeInit (struct varjo_Session *session) |
Initializes the gaze tracking system. More... | |
void | varjo_GazeInitWithParameters (struct varjo_Session *session, struct varjo_GazeParameters *parameters, int32_t parameterCount) |
Initializes the gaze tracking system with provided parameters. More... | |
varjo_Bool | varjo_IsGazeAllowed (struct varjo_Session *session) |
Is gaze allowed to be used? More... | |
void | varjo_RequestGazeCalibration (struct varjo_Session *session) |
Requests a HMD gaze calibration. More... | |
void | varjo_RequestGazeCalibrationWithParameters (struct varjo_Session *session, struct varjo_GazeCalibrationParameters *parameters, int32_t parameterCount) |
Requests a HMD gaze calibration with provided parameters. More... | |
struct varjo_Gaze | varjo_GetGaze (struct varjo_Session *session) |
Gets the current state of the user gaze. More... | |
int32_t | varjo_GetGazeArray (struct varjo_Session *session, struct varjo_Gaze *array, int32_t maxSize) |
Gets gaze measurements since last query. More... | |
void | varjo_SyncProperties (struct varjo_Session *session) |
Updates and synchronizes system properties with the system state. More... | |
int32_t | varjo_GetPropertyCount (struct varjo_Session *session) |
Gets the number of system properties. More... | |
varjo_PropertyKey | varjo_GetPropertyKey (struct varjo_Session *session, int32_t index) |
Gets a property key for a property index. More... | |
const char * | varjo_GetPropertyName (struct varjo_Session *session, varjo_PropertyKey propertyKey) |
Gets the name of the property key. More... | |
varjo_Bool | varjo_HasProperty (struct varjo_Session *session, varjo_PropertyKey propertyKey) |
Checks if the key has value in the properties. More... | |
varjo_Bool | varjo_GetPropertyBool (struct varjo_Session *session, varjo_PropertyKey propertyKey) |
Gets a boolean value of a property. More... | |
double | varjo_GetPropertyDouble (struct varjo_Session *session, varjo_PropertyKey propertyKey) |
Gets a floating point value of a property. More... | |
int32_t | varjo_GetPropertyInt (struct varjo_Session *session, varjo_PropertyKey propertyKey) |
Gets an integer value of a property. More... | |
void | varjo_GetPropertyString (struct varjo_Session *session, varjo_PropertyKey propertyKey, char *buffer, uint32_t maxSize) |
Gets a string value of a property. More... | |
uint32_t | varjo_GetPropertyStringSize (struct varjo_Session *session, varjo_PropertyKey propertyKey) |
Gets the size of a buffer that is big enough to hold the property, including the null terminator. More... | |
struct varjo_SwapChainLimits | varjo_GetSwapChainLimits (struct varjo_Session *session) |
Gets swap chain limits. More... | |
void | varjo_GetSupportedTextureFormats (struct varjo_Session *session, varjo_RenderAPI renderApi, int32_t *formatCount, varjo_TextureFormat *formats) |
Gets supported texture formats in the order of most preferred to least preferred. More... | |
struct varjo_Event * | varjo_AllocateEvent () |
Allocates an event. More... | |
void | varjo_FreeEvent (struct varjo_Event *event) |
Free an event. More... | |
varjo_Bool | varjo_PollEvent (struct varjo_Session *session, struct varjo_Event *evt) |
Polls events. More... | |
void | varjo_GetTextureSize (struct varjo_Session *session, varjo_TextureSize_Type type, int32_t viewIndex, int32_t *width, int32_t *height) |
Gets texture size for specific varjo_TextureSize_type and view index. More... | |
void | varjo_D3D12UpdateVariableRateShadingTexture (struct varjo_Session *session, struct ID3D12GraphicsCommandList *commandList, struct ID3D12Resource *texture, struct varjo_VariableRateShadingConfig *config) |
Creates variable rate shading texture. More... | |
void | varjo_D3D11UpdateVariableRateShadingTexture (struct varjo_Session *session, struct ID3D11Device *device, struct ID3D11Texture2D *texture, struct varjo_VariableRateShadingConfig *config, struct varjo_ShadingRateTable *shadingRateTable) |
Updates variable rate shading texture. More... | |
void | varjo_GLUpdateVariableRateShadingTexture (struct varjo_Session *session, unsigned int texture, int width, int height, struct varjo_VariableRateShadingConfig *config, struct varjo_ShadingRateTable *shadingRateTable) |
Updates variable rate shading texture. More... | |
varjo_Bool | varjo_GetRenderingGaze (struct varjo_Session *session, struct varjo_Gaze *gaze) |
Returns gaze which can be used for foveated rendering or to generate variable rate shading texture. More... | |
struct varjo_FovTangents | varjo_GetFoveatedFovTangents (struct varjo_Session *session, int32_t indexView, struct varjo_Gaze *gaze, struct varjo_FoveatedFovTangents_Hints *hints) |
Returns foveated view tangents for a given index and gaze vector. More... | |
struct varjo_FovTangents | varjo_GetFovTangents (struct varjo_Session *session, int32_t viewIndex) |
Returns tangents for a given view index. More... | |
struct varjo_Event* varjo_AllocateEvent | ( | ) |
Allocates an event.
Helper function if you don't want to do the allocation by yourself.
struct varjo_Matrix varjo_ApplyTransform | ( | struct varjo_Session * | session, |
struct varjo_Matrix * | m1, | ||
struct varjo_Matrix * | m2 | ||
) |
Applies transform using post multiplication.
session | Varjo session handle. |
m1 | First transform. |
m2 | Second transform. |
struct varjo_FrameInfo* varjo_CreateFrameInfo | ( | struct varjo_Session * | session | ) |
Creates a frame info with initial values.
Allocates enough data to hold all of the views.
Use varjo_FreeFrameInfo to free the allocated memory.
session | Varjo session handle. |
struct varjo_Mesh2Df* varjo_CreateOcclusionMesh | ( | struct varjo_Session * | session, |
int32_t | viewIndex, | ||
varjo_WindingOrder | windingOrder | ||
) |
Creates the occlusion mesh for a given view index.
Due to lens distortion some display pixels are not visible in the optical path so the application can stencil out pixels to reduce shading workload and improve performance.
Mesh data is a triangle list where each triplet of vertices forms a triangle.
Use varjo_FreeOcclusionMesh to free the created mesh.
session | Varjo session handle. |
viewIndex | View number to get the occlusion mesh for. Must be in range [0, varjo_GetViewCount - 1]. |
windingOrder | Winding order of the triangles |
void varjo_D3D11UpdateVariableRateShadingTexture | ( | struct varjo_Session * | session, |
struct ID3D11Device * | device, | ||
struct ID3D11Texture2D * | texture, | ||
struct varjo_VariableRateShadingConfig * | config, | ||
struct varjo_ShadingRateTable * | shadingRateTable | ||
) |
Updates variable rate shading texture.
This function will add execution of compute shader which will calculate best possible VRS map based on flags. Function should be executed as late as possible to get most recent gaze. Function should be called as many times as there are views: 4 or 2.
session | Varjo session handle. |
device | D3D11 device. |
texture | Texture which will be used as VRS map. Format must be R8 UINT. |
config | Configuration flags. |
shadingRateTable | Array that specifies which shading rate matches which integer value. This is very similar to shading rate table in NV_D3D11_VIEWPORT_SHADING_RATE_DESC_V1. |
void varjo_D3D12UpdateVariableRateShadingTexture | ( | struct varjo_Session * | session, |
struct ID3D12GraphicsCommandList * | commandList, | ||
struct ID3D12Resource * | texture, | ||
struct varjo_VariableRateShadingConfig * | config | ||
) |
Creates variable rate shading texture.
This function will add execution of compute shader which will calculate best possible VRS map based on flags. Command list should be executed as late as possible to get most recent gaze. Function should be called as many times as there are views: 4 or 2.
Texture has to be in D3D12_RESOURCE_STATE_UNORDERED_ACCESS state.
session | Varjo session handle. |
commandList | D3D12 command list. |
texture | Texture which will be used as VRS map. Format must be R8 UINT. |
config | Configuration flags. |
varjo_Nanoseconds varjo_FrameGetDisplayTime | ( | struct varjo_Session * | session | ) |
Gets the time when the frame is scheduled to be displayed.
This time refers to the average perceived moment of when the image is shown.
The display time is updated in varjo_WaitSync and is guaranteed to remain constant for the duration of the frame.
This is a helper function for when you don't have access to varjo_FrameInfo.
session | Varjo session handle. |
struct varjo_Matrix varjo_FrameGetPose | ( | struct varjo_Session * | session, |
varjo_PoseType | type | ||
) |
Gets a pose for the current frame.
If it's called before varjo_WaitSync() is complete, it will return new pose. Following calls to varjo_FrameGetPose() will return the same matrix. varjo_WaitSync() will also derive it's matrices from that pose. If varjo_FrameGetPose() is called after varjo_WaitSync() it will derive matrices from that pose.
session | Varjo session handle. |
type | Type of the pose. |
void varjo_FreeEvent | ( | struct varjo_Event * | event | ) |
void varjo_FreeFrameInfo | ( | struct varjo_FrameInfo * | frameInfo | ) |
Frees an allocated frame info.
frameInfo | Frame info to free. |
void varjo_FreeOcclusionMesh | ( | struct varjo_Mesh2Df * | mesh | ) |
Frees the memory allocated by varjo_CreateOcclusionMesh.
mesh | Occlusion mesh to free. |
void varjo_GazeInit | ( | struct varjo_Session * | session | ) |
Initializes the gaze tracking system.
session | Varjo session handle. |
void varjo_GazeInitWithParameters | ( | struct varjo_Session * | session, |
struct varjo_GazeParameters * | parameters, | ||
int32_t | parameterCount | ||
) |
Initializes the gaze tracking system with provided parameters.
session | Varjo session handle. |
parameters | Gaze key-value parameters. |
parameterCount | Number of parameters provided. |
struct varjo_AlignedView varjo_GetAlignedView | ( | double * | projectionMatrix | ) |
Gets an aligned view from a projection matrix.
Note: the projection matrix from varjo_FrameInfo might not always be axis aligned.
projectionMatrix | Projection matrix. |
varjo_Nanoseconds varjo_GetCurrentTime | ( | struct varjo_Session * | session | ) |
Gets the current time in a format that Varjo API uses.
This is a realtime monotonic counter since system-specific starting point and is not affected by time-of-day setting.
session | Varjo session handle. |
varjo_Error varjo_GetError | ( | struct varjo_Session * | session | ) |
Gets the latest error code.
You should check for errors at least once a frame.
Error status will be cleared after this function.
Use varjo_GetErrorDesc to get more detailed error description.
const char* varjo_GetErrorDesc | ( | varjo_Error | error | ) |
Gets error description for the specified error code.
struct varjo_FovTangents varjo_GetFoveatedFovTangents | ( | struct varjo_Session * | session, |
int32_t | indexView, | ||
struct varjo_Gaze * | gaze, | ||
struct varjo_FoveatedFovTangents_Hints * | hints | ||
) |
Returns foveated view tangents for a given index and gaze vector.
varjo_Error_GazeInvalid error will be set if the provided gaze is not valid.
session | Varjo session handle |
indexView | View index in range [0, varjo_GetViewCount() - 1]. |
gaze | A valid gaze, returned by varjo_GetRenderingGaze(). |
hints | A non-null pointer to a varjo_FoveatedFovTangents_Hints struct. |
struct varjo_FovTangents varjo_GetFovTangents | ( | struct varjo_Session * | session, |
int32_t | viewIndex | ||
) |
Returns tangents for a given view index.
session | Varjo session handle |
viewIndex | View index in range [0, varjo_GetViewCount() - 1]. |
struct varjo_Gaze varjo_GetGaze | ( | struct varjo_Session * | session | ) |
Gets the current state of the user gaze.
Gaze system must have been previously initialized by calling varjo_GazeInit or varjo_GazeInitWithParameters.
session | Varjo session handle. |
int32_t varjo_GetGazeArray | ( | struct varjo_Session * | session, |
struct varjo_Gaze * | array, | ||
int32_t | maxSize | ||
) |
Gets gaze measurements since last query.
Gaze system must have been previously initialized by calling varjo_GazeInit or varjo_GazeInitWithParameters.
session | Varjo session handle. |
array | Array of varjo_Gaze structures |
maxSize | Number of elements in array |
varjo_Bool varjo_GetPropertyBool | ( | struct varjo_Session * | session, |
varjo_PropertyKey | propertyKey | ||
) |
Gets a boolean value of a property.
session | Varjo session handle. |
propertyKey | The property key. |
int32_t varjo_GetPropertyCount | ( | struct varjo_Session * | session | ) |
Gets the number of system properties.
session | Varjo session handle. |
double varjo_GetPropertyDouble | ( | struct varjo_Session * | session, |
varjo_PropertyKey | propertyKey | ||
) |
Gets a floating point value of a property.
session | Varjo session handle. |
propertyKey | The property key. |
int32_t varjo_GetPropertyInt | ( | struct varjo_Session * | session, |
varjo_PropertyKey | propertyKey | ||
) |
Gets an integer value of a property.
session | Varjo session handle. |
propertyKey | The property key. |
varjo_PropertyKey varjo_GetPropertyKey | ( | struct varjo_Session * | session, |
int32_t | index | ||
) |
Gets a property key for a property index.
session | Varjo session handle. |
index | Zero-based index. |
const char* varjo_GetPropertyName | ( | struct varjo_Session * | session, |
varjo_PropertyKey | propertyKey | ||
) |
Gets the name of the property key.
session | Varjo session handle. |
propertyKey | The property key. |
void varjo_GetPropertyString | ( | struct varjo_Session * | session, |
varjo_PropertyKey | propertyKey, | ||
char * | buffer, | ||
uint32_t | maxSize | ||
) |
Gets a string value of a property.
A null-terminated string will be returned to the given buffer. The string will not be copied if the size is smaller than the length of the property string + 1 (null terminator), i.e. truncation will not happen.
session | Varjo session handle. |
propertyKey | The property key. |
buffer | Pointer to a char buffer. |
maxSize | Size of the given char buffer. |
uint32_t varjo_GetPropertyStringSize | ( | struct varjo_Session * | session, |
varjo_PropertyKey | propertyKey | ||
) |
Gets the size of a buffer that is big enough to hold the property, including the null terminator.
session | Varjo session handle. |
propertyKey | The property key. |
struct varjo_Matrix varjo_GetRelativePoseTransform | ( | struct varjo_Session * | session, |
varjo_PoseType | src, | ||
varjo_PoseType | dest | ||
) |
Gets a relative transformation from source pose to destination pose.
session | Varjo session handle. |
src | Source pose. |
dest | Destination pose. |
varjo_Bool varjo_GetRenderingGaze | ( | struct varjo_Session * | session, |
struct varjo_Gaze * | gaze | ||
) |
Returns gaze which can be used for foveated rendering or to generate variable rate shading texture.
It may not be the same as the one returned by varjo_GetGaze(). For example, it handles eye blinks and doesn't return invalid gaze in those cases.
varjo_Error_NullPointer error will be set if the gaze pointer is null.
session | Varjo session handle. |
gaze | A pointer to valid varjo_Gaze. |
void varjo_GetSupportedTextureFormats | ( | struct varjo_Session * | session, |
varjo_RenderAPI | renderApi, | ||
int32_t * | formatCount, | ||
varjo_TextureFormat * | formats | ||
) |
Gets supported texture formats in the order of most preferred to least preferred.
To allocate memory for the formats
output buffer, you should first call this function by passing null formats
and query the count for the formats.
session | Varjo session handle. |
renderApi | Rendering API being used. |
formatCount | Output pointer for the format count. Cannot be null. |
formats | Output pointer for the formats. Can be null. |
struct varjo_SwapChainLimits varjo_GetSwapChainLimits | ( | struct varjo_Session * | session | ) |
Gets swap chain limits.
session | Varjo session handle. |
void varjo_GetTextureSize | ( | struct varjo_Session * | session, |
varjo_TextureSize_Type | type, | ||
int32_t | viewIndex, | ||
int32_t * | width, | ||
int32_t * | height | ||
) |
Gets texture size for specific varjo_TextureSize_type and view index.
Check varjo_TextureSize_Type description for details about different varjo_TextureSize_type.
session | Varjo session handle. |
type | Requeste texture size type. |
viewIndex | View index. |
width | A pointer to an int which will contain width (cannot be null). |
height | A pointer to an int which will contain height (cannot be null). |
struct varjo_Matrix varjo_GetTrackingToLocalTransform | ( | struct varjo_Session * | session | ) |
Transform from tracking space to local client space.
Client space may differ from tracking space if: client has explicitly called varjo_ResetPose or by implicit change of tracking origin for all clients. Client should use varjo_GetTrackingToLocalTransform() in order to sync tracking space poses (e.g. controller poses) with client local space poses.
session | Varjo session handle. |
const uint64_t varjo_GetVersion | ( | ) |
Gets the version number of the runtime.
Use VARJO_MAKE_VERSION macro to create a version that can be then used to test against the returned version number.
Note that VarjoLib version is stored in VARJO_VERSION define.
eg. VARJO_MAKE_VERSION(0, 7, 0, 0) >= varjo_GetVersion()
const char* varjo_GetVersionString | ( | ) |
Gets the short version of the runtime.
Eg. "0.7.0.0".
int32_t varjo_GetViewCount | ( | struct varjo_Session * | session | ) |
Gets numbers of views.
session | Varjo session handle. |
struct varjo_ViewDescription varjo_GetViewDescription | ( | struct varjo_Session * | session, |
int32_t | viewIndex | ||
) |
Gets the display information for a given view.
Use this to retrieve information about which display or eye the given view belongs to.
varjo_ViewDescription also contains the recommended render texture dimensions. Use varjo_GetTextureSize to query sizes for various different purposes (for example, best quality rendering).
session | Varjo session handle. |
viewIndex | View number to get the display information for. Must be in range [0, varjo_GetViewCount - 1]. |
void varjo_GLUpdateVariableRateShadingTexture | ( | struct varjo_Session * | session, |
unsigned int | texture, | ||
int | width, | ||
int | height, | ||
struct varjo_VariableRateShadingConfig * | config, | ||
struct varjo_ShadingRateTable * | shadingRateTable | ||
) |
Updates variable rate shading texture.
This function will add execution of compute shader which will calculate best possible VRS map based on flags. Function should be executed as late as possible to get most recent gaze. Function should be called as many times as there are views: 4 or 2.
session | Varjo session handle. |
texture | OpenGL texture (GLuint) which will be used as VRS map. Format must be GL_R8UI. |
width | Texture width. |
height | Texture height. |
config | Configuration flags. |
shadingRateTable | Array that specifies which shading rate matches which integer value. This is very similar to shading rate palette in glShadingRateImagePaletteNV. |
varjo_Bool varjo_HasProperty | ( | struct varjo_Session * | session, |
varjo_PropertyKey | propertyKey | ||
) |
Checks if the key has value in the properties.
session | Varjo session handle. |
propertyKey | The property key. |
varjo_Bool varjo_IsAvailable | ( | ) |
Checks whether Varjo system is available.
If varjo_IsAvailable() returns false, it is guaranteed that the session cannot be initialized. If this returns true, application may try initiating a new session.
This call executes fast and can be called per frame unlike varjo_SessionInit.
varjo_Bool varjo_IsGazeAllowed | ( | struct varjo_Session * | session | ) |
Is gaze allowed to be used?
User can disallow gaze tracking completely.
session | Varjo session handle. |
varjo_Bool varjo_PollEvent | ( | struct varjo_Session * | session, |
struct varjo_Event * | evt | ||
) |
Polls events.
Holds the latest 100 events in the queue. If the queue size exceeds that, starts dropping events starting from the oldest. Make sure to call often enough (eg. once per frame) if you don't want to miss an event.
Use this in a loop to go through all of the queued events.
session | Varjo session handle. |
evt | Event to receive data to. |
void varjo_RequestGazeCalibration | ( | struct varjo_Session * | session | ) |
Requests a HMD gaze calibration.
This attempts to trigger the gaze calibration sequence if the user has allowed gaze tracking from Varjo settings and Varjo system is in a state where it can bring up the calibration UI.
session | Varjo session handle. |
void varjo_RequestGazeCalibrationWithParameters | ( | struct varjo_Session * | session, |
struct varjo_GazeCalibrationParameters * | parameters, | ||
int32_t | parameterCount | ||
) |
Requests a HMD gaze calibration with provided parameters.
This attempts to trigger the gaze calibration sequence if the user has allowed gaze tracking from Varjo settings and Varjo system is in a state where it can bring up the calibration UI.
session | Varjo session handle. |
parameters | Gaze calibration key-value parameters. |
parameterCount | Number of parameters provided. |
void varjo_ResetPose | ( | struct varjo_Session * | session, |
varjo_Bool | position, | ||
varjo_RotationReset | rotation | ||
) |
Resets pose tracking origin.
This will reset the tracking origin to the current transform of the user. rotation parameter can be used to reset only some components of the transform.
session | Varjo session handle. |
position | Reset position |
rotation | Rotation reset type |
struct varjo_Session* varjo_SessionInit | ( | void | ) |
Initializes a Varjo client session.
varjo_SessionInit initializes a new Varjo session and returns an opaque pointer handle representing the session which should be passed to all Varjo API calls that are related to this session. When done, the session needs to be cleaned up by calling varjo_SessionShutDown.
There can be multiple simultaneous sessions, but generally applications don't need more than one. Single session can be shared between different threads.
void varjo_SessionSetPriority | ( | struct varjo_Session * | session, |
int32_t | priority | ||
) |
Sets session overlay priority.
All sessions are grouped based on this value. Only one session from a group is displayed. Higher priority sessions are overlaid on top of lower priority one's.
session | Varjo session handle. |
priority | Varjo session priority. Negative values allowed. Zero on SessionInit by default. |
void varjo_SessionShutDown | ( | struct varjo_Session * | session | ) |
Shuts down a session and releases all the resources internally allocated by Varjo session.
Session pointer will become invalid after calling this function.
session | Varjo session handle. |
void varjo_SetCenteredProjection | ( | struct varjo_Session * | session, |
varjo_Bool | enabled | ||
) |
Forces the provided projection matrices to be centered.
This may result in suboptimal resolution.
session | Varjo session handle. |
enabled | True, if the matrices need to be centered. False if off-center projection is ok. |
void varjo_SyncProperties | ( | struct varjo_Session * | session | ) |
Updates and synchronizes system properties with the system state.
session | Varjo session handle. |
void varjo_WaitSync | ( | struct varjo_Session * | session, |
struct varjo_FrameInfo * | frameInfo | ||
) |
Called at the start of a frame.
Obtains required metadata for the frame and blocks until optimal time to start rendering so that the application can use the latest possible pose data. In some cases, compositor may block the call for longer duration. (e.g. if it has something else to display.)
varjo_WaitSync() and varjo_FrameGetPose() will always derive matrixes from the same pose. So it's safe to call varjo_FrameGetPose() before varjo_WaitSync() is complete.
session | Varjo session handle. |
frameInfo | Output pointer for frame info. |