Functions requiring an exclusive connection. More...
Functions | |
T5_EXPORT T5_Result | t5GetGlassesPose (T5_Glasses glasses, T5_GlassesPoseUsage usage, T5_GlassesPose *pose) |
Get the latest pose of the glasses. More... | |
T5_EXPORT T5_Result | t5InitGlassesGraphicsContext (T5_Glasses glasses, T5_GraphicsApi graphicsApi, void *graphicsContext) |
Initialize the graphics context to enable sending rendered frames to the glasses. More... | |
T5_EXPORT T5_Result | t5SendFrameToGlasses (T5_Glasses glasses, const T5_FrameInfo *info) |
Send a frame to display on the glasses. More... | |
Functions requiring an exclusive connection.
Exclusive connections are established with t5ReserveGlasses() and t5EnsureGlassesReady().
T5_EXPORT T5_Result t5GetGlassesPose | ( | T5_Glasses | glasses, |
T5_GlassesPoseUsage | usage, | ||
T5_GlassesPose * | pose | ||
) |
Get the latest pose of the glasses.
[in] | glasses | - T5_Glasses returned by t5CreateGlasses(). |
[in] | usage | - T5_GlassesPoseUsage indicating the intended use for the glasses pose. |
[out] | pose | - T5_GlassesPose representing current glasses pose. |
T5_SUCCESS | Pose written to pose . |
T5_ERROR_INVALID_ARGS | Nullptr was supplied for pose . |
T5_ERROR_NO_CONTEXT | glasses is invalid. |
T5_ERROR_NOT_CONNECTED | Glasses aren't exclusively connected for this client. Use t5ReserveGlasses() and t5EnsureGlassesReady() first. |
T5_ERROR_TRY_AGAIN | Pose wasn't been received from glasses yet. |
T5_ERROR_INTERNAL | Internal error - not correctable. |
Referenced by tiltfive::Glasses::getLatestGlassesPose().
T5_EXPORT T5_Result t5InitGlassesGraphicsContext | ( | T5_Glasses | glasses, |
T5_GraphicsApi | graphicsApi, | ||
void * | graphicsContext | ||
) |
Initialize the graphics context to enable sending rendered frames to the glasses.
The value of graphicsContext will depend on what library your application is using. Refer to Graphics APIs for more details.
Note that not all values are supported on all platforms (E.g. D3D is only available on Windows).
[in] | glasses | - T5_Glasses returned by t5CreateGlasses(). |
[in] | graphicsApi | - T5_GraphicsApi specifying the graphics API for the glasses. |
[in] | graphicsContext | - Meaning depends on the graphics API in use. (Vulkan only: You can free T5_GraphicsContextVulkan on return.) |
T5_SUCCESS | The graphics context was successfully initialized. |
T5_ERROR_INVALID_ARGS | graphicsApi was kT5_GraphicsApi_None. |
T5_ERROR_INVALID_STATE | t5InitGlassesGraphicsContext() was previously called on this Glasses object. |
Referenced by tiltfive::Glasses::initGraphicsContext().
T5_EXPORT T5_Result t5SendFrameToGlasses | ( | T5_Glasses | glasses, |
const T5_FrameInfo * | info | ||
) |
Send a frame to display on the glasses.
Both left and right stereoscopic images are presented together via this call. The textures referred to by the leftTexHandle
and rightTexHandle
fields of info will be used within this call to enqueue and submit graphics operations that will read the texture data. Once this call returns, no additional operations referencing those textures will be performed. However, depending on the graphics API being used, the application may need to perform additional synchronization prior to freeing the texture resources in order to ensure that the queued graphics operations have completed.
[in] | glasses | - T5_Glasses returned by t5CreateGlasses(). |
[in] | info | - T5_FrameInfo detailing the frame to display. |
T5_SUCCESS | The frame was successfully queued to be sent. |
T5_ERROR_INVALID_ARGS | Nullptr was supplied for info . |
T5_ERROR_INVALID_STATE | graphicsApi was kT5_GraphicsApi_None when t5CreateGlasses() was called. |
T5_ERROR_NOT_CONNECTED | Glasses aren't exclusively connected for this client. Use t5ReserveGlasses() and t5EnsureGlassesReady() first. |
T5_ERROR_INVALID_GFX_CONTEXT | Graphics context is invalid. Check that graphicsContext was correct when t5InitGraphicsContext() was called. |
T5_ERROR_GFX_CONTEXT_INIT_FAIL | Failed to initialize graphics context. Exact meaning depends on current graphics API. |
T5_ERROR_NO_CONTEXT | glasses is invalid. |
T5_ERROR_INTERNAL | Internal error - not correctable. |
Referenced by tiltfive::Glasses::sendFrame().