Tilt Five NDK  1.4.1
TiltFiveNative.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020-2023 Tilt Five, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
21
22#include "errors.h"
23#include "types.h"
24
25#ifndef __cplusplus
26#include <stddef.h>
27#else
28#include <cstddef>
29#endif
30
31#ifdef _WIN32
32#ifdef BUILDING_T5_NATIVE_DLL
33#ifdef __GNUC__
34#define T5_EXPORT __attribute__((dllexport))
35#else // !__GNUC__
36#define T5_EXPORT __declspec(dllexport)
37#endif // !__GNUC__
38#else // !BUILDING_T5_NATIVE_DLL
39#define T5_EXPORT
40#endif // !BUILDING_T5_NATIVE_DLL
41#else // !_WIN32
42#define T5_EXPORT __attribute__((visibility("default")))
43#endif // !_WIN32
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
52
56
59
100 const T5_ClientInfo* clientInfo,
101 void* platformContext);
102
116T5_EXPORT void t5DestroyContext(T5_Context* context);
117
119// C_Ctx
120
124
163T5_EXPORT T5_Result t5ListGlasses(T5_Context context, char* buffer, size_t* bufferSize);
164
191T5_EXPORT T5_Result t5CreateGlasses(T5_Context context, const char* id, T5_Glasses* glasses);
192
206T5_EXPORT void t5DestroyGlasses(T5_Glasses* glasses);
207
209
240T5_EXPORT T5_Result t5GetSystemIntegerParam(T5_Context context, T5_ParamSys param, int64_t* value);
241
272T5_EXPORT T5_Result t5GetSystemFloatParam(T5_Context context, T5_ParamSys param, double* value);
273
315 T5_ParamSys param,
316 char* buffer,
317 size_t* bufferSize);
318
345 T5_ParamSys* buffer,
346 uint16_t* count);
347
361 T5_GameboardType gameboardType,
362 T5_GameboardSize* gameboardSize);
364// C_Sys
365
369
372
407T5_EXPORT T5_Result t5ReserveGlasses(T5_Glasses glasses, const char* displayName);
408
425T5_EXPORT T5_Result t5SetGlassesDisplayName(T5_Glasses glasses, const char* displayName);
426
458
474
489 T5_ConnectionState* connectionState);
490
510T5_EXPORT T5_Result t5GetGlassesIdentifier(T5_Glasses glasses, char* buffer, size_t* bufferSize);
511
516
541 T5_GlassesPose* pose);
542
570 T5_GraphicsApi graphicsApi,
571 void* graphicsContext);
572
592 T5_CameraStreamConfig config);
593
599//
620
622//
650
652//
669T5_EXPORT T5_Result t5CancelCamImageBuffer(T5_Glasses glasses, uint8_t* buffer);
670
688//
714
759 const T5_FrameInfo* info,
760 char* detail,
761 size_t* detailSize);
762
765
796 T5_WandHandle wand,
797 T5_ParamGlasses param,
798 int64_t* value);
799
830 T5_WandHandle wand,
831 T5_ParamGlasses param,
832 double* value);
833
874 T5_WandHandle wand,
875 T5_ParamGlasses param,
876 char* buffer,
877 size_t* bufferSize);
878
903 T5_ParamGlasses* buffer,
904 uint16_t* count);
905
959 T5_DepthRange depthRange,
960 T5_MatrixOrder matrixOrder,
961 double nearPlane,
962 double farPlane,
963 double worldScale,
964 T5_ProjectionInfo* projectionInfo);
965
968
1002 T5_WandHandle* buffer,
1003 uint8_t* count);
1004
1031 T5_WandHandle wand,
1032 float amplitude,
1033 uint16_t duration);
1034
1055 const T5_WandStreamConfig* config);
1056
1091 T5_WandStreamEvent* event,
1092 uint32_t timeoutMs);
1093
1095// C_Gls
1096
1098// C_Glasses_Interface
1099
1100#ifdef __cplusplus
1101}
1102#endif
1103
1104#undef T5_EXPORT
1105
constexpr iterator_traits< _InputIterator >::difference_type count(_InputIterator __first, _InputIterator __last, const _Tp &__value)
C errors for the Tilt Five™ API.
uint32_t T5_Result
Represents an error code that may be returned by the Tilt Five™ API.
Definition: errors.h:47
T5_ConnectionState
Glasses connection state.
Definition: types.h:234
T5_MatrixOrder
Matrix order.
Definition: types.h:68
T5_ParamGlasses
Possible parameters that can be retrieved for glasses.
Definition: types.h:500
uint8_t T5_WandHandle
Opaque handle used with wands.
Definition: types.h:104
T5_DepthRange
Z Depth range.
Definition: types.h:74
struct T5_ContextImpl * T5_Context
Opaque handle used with system-wide functions.
Definition: types.h:92
T5_GraphicsApi
Graphics API types.
Definition: types.h:107
T5_ParamSys
Possible parameters that can be retrieved with System-wide parameters.
Definition: types.h:510
T5_GameboardType
Possible gameboard types.
Definition: types.h:179
struct T5_GlassesImpl * T5_Glasses
Opaque handle used with glasses.
Definition: types.h:98
T5_GlassesPoseUsage
Glasses pose usage indicator.
Definition: types.h:249
T5_CartesianCoordinateHandedness
Handedness of a cartesian coordinate system.
Definition: types.h:83
T5_EXPORT T5_Result t5CreateContext(T5_Context *context, const T5_ClientInfo *clientInfo, void *platformContext)
Create a context object.
T5_EXPORT void t5DestroyContext(T5_Context *context)
Destroy a context object.
T5_EXPORT T5_Result t5CancelCamImageBuffer(T5_Glasses glasses, uint8_t *buffer)
Clear out the remaining buffers and return all buffers as a vector of camera images.
T5_EXPORT T5_Result t5GetFilledCamImageBuffer(T5_Glasses glasses, T5_CamImage *image)
T5_EXPORT T5_Result t5ReleaseGlasses(T5_Glasses glasses)
T5_EXPORT T5_Result t5ConfigureCameraStreamForGlasses(T5_Glasses glasses, T5_CameraStreamConfig config)
Configure the camera stream.
T5_EXPORT T5_Result t5ValidateFrameInfo(T5_Glasses glasses, const T5_FrameInfo *info, char *detail, size_t *detailSize)
Validate a provided T5_FrameInfo.
T5_EXPORT T5_Result t5GetProjection(T5_Glasses glasses, T5_CartesianCoordinateHandedness handedness, T5_DepthRange depthRange, T5_MatrixOrder matrixOrder, double nearPlane, double farPlane, double worldScale, T5_ProjectionInfo *projectionInfo)
Get projection properties for glasses.
T5_EXPORT T5_Result t5SubmitEmptyCamImageBuffer(T5_Glasses glasses, T5_CamImage *image)
Submit an empty image buffer to be filled by the camera frame stream.
T5_EXPORT T5_Result t5CreateGlasses(T5_Context context, const char *id, T5_Glasses *glasses)
Create a glasses access object.
T5_EXPORT T5_Result t5GetGameboardSize(T5_Context context, T5_GameboardType gameboardType, T5_GameboardSize *gameboardSize)
Get the gameboard dimensions.
T5_EXPORT void t5DestroyGlasses(T5_Glasses *glasses)
Destroy a glasses object.
T5_EXPORT T5_Result t5ListGlasses(T5_Context context, char *buffer, size_t *bufferSize)
Enumerate all glasses.
T5_EXPORT T5_Result t5SendFrameToGlasses(T5_Glasses glasses, const T5_FrameInfo *info)
Send a frame to display on the glasses.
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.
T5_EXPORT T5_Result t5GetGlassesPose(T5_Glasses glasses, T5_GlassesPoseUsage usage, T5_GlassesPose *pose)
Get the latest pose of the glasses.
T5_EXPORT T5_Result t5SetGlassesDisplayName(T5_Glasses glasses, const char *displayName)
Set the display name for glasses that were previously reserved for exclusive operations.
T5_EXPORT T5_Result t5GetGlassesConnectionState(T5_Glasses glasses, T5_ConnectionState *connectionState)
Get the exclusivity/connection status of the glasses.
T5_EXPORT T5_Result t5ReserveGlasses(T5_Glasses glasses, const char *displayName)
Reserve glasses for exclusive operations by the client.
T5_EXPORT T5_Result t5GetGlassesIdentifier(T5_Glasses glasses, char *buffer, size_t *bufferSize)
Get the device identifier of a glasses.
T5_EXPORT T5_Result t5EnsureGlassesReady(T5_Glasses glasses)
Ensure that reserved glasses are ready for exclusive operations.
T5_EXPORT T5_Result t5GetGlassesFloatParam(T5_Glasses glasses, T5_WandHandle wand, T5_ParamGlasses param, double *value)
Get a glasses floating point parameter.
T5_EXPORT T5_Result t5GetGlassesUtf8Param(T5_Glasses glasses, T5_WandHandle wand, T5_ParamGlasses param, char *buffer, size_t *bufferSize)
Get a glasses UTF-8 encoded string parameter.
T5_EXPORT T5_Result t5GetChangedGlassesParams(T5_Glasses glasses, T5_ParamGlasses *buffer, uint16_t *count)
Get a glasses-specific list of changed parameters.
T5_EXPORT T5_Result t5GetGlassesIntegerParam(T5_Glasses glasses, T5_WandHandle wand, T5_ParamGlasses param, int64_t *value)
Get a glasses integer parameter.
T5_EXPORT T5_Result t5GetSystemFloatParam(T5_Context context, T5_ParamSys param, double *value)
Get a system-wide floating point parameter.
T5_EXPORT T5_Result t5GetSystemUtf8Param(T5_Context context, T5_ParamSys param, char *buffer, size_t *bufferSize)
Get a system-wide UTF-8 encoded string parameter.
T5_EXPORT T5_Result t5GetSystemIntegerParam(T5_Context context, T5_ParamSys param, int64_t *value)
Get a system-wide integer parameter.
T5_EXPORT T5_Result t5GetChangedSystemParams(T5_Context context, T5_ParamSys *buffer, uint16_t *count)
Get a system-wide list of changed parameters.
T5_EXPORT T5_Result t5ReadWandStreamForGlasses(T5_Glasses glasses, T5_WandStreamEvent *event, uint32_t timeoutMs)
Read from the wands event stream.
T5_EXPORT T5_Result t5ListWandsForGlasses(T5_Glasses glasses, T5_WandHandle *buffer, uint8_t *count)
List available wands connected to this glasses.
T5_EXPORT T5_Result t5SendImpulse(T5_Glasses glasses, T5_WandHandle wand, float amplitude, uint16_t duration)
Send a haptic data buffer to a wand.
T5_EXPORT T5_Result t5ConfigureWandStreamForGlasses(T5_Glasses glasses, const T5_WandStreamConfig *config)
Configure the wand event stream.
Camera Frame information to be retrieved with t5GetFilledCamImageBuffer()
Definition: types.h:357
Camera stream configuration.
Definition: types.h:297
Client provided information for use with t5CreateGlasses()
Definition: types.h:217
Render information to be used with t5SendFrameToGlasses()
Definition: types.h:306
Physical dimensions of a gameboard.
Definition: types.h:194
Glasses pose information to be retrieved with t5GetGlassesPose()
Definition: types.h:280
Projection parameters.
Definition: types.h:520
Wand stream configuration.
Definition: types.h:393
Represents an event from the wand stream.
Definition: types.h:485