Function usage
The Top Level API provides the following global functions:
Init()
int Init(StatusCallback callback, string viveportId)
Name | Type | Description |
callback | StatusCallback | |
viveportId | string | VIVEPORT ID |
Returns:
int
. A value of
1
means the function has completed without error.
Initializes the VIVEPORT SDK and allocates resources (such as memory). This function must return successfully before calling any other APIs in the VIVEPORT SDK.
Shutdown()
int Shutdown(StatusCallback callback);
Name | Type | Description |
callback | StatusCallback |
Returns:
int
. A value of
1
means the function has completed without error.
Shuts down the SDK and frees up resources when they are no longer needed.
Version()
string Version();
Returns:
string
. Returns the current version of the client SDK.
QueryRuntimeMode()
void QueryRuntimeMode(QueryRunTimeHandler);
Retrieves runtime information from the
QueryRuntimeHandler()
callback to determine which VIVEPORT platform is being used.
QueryRunTimeHandler()
delegate void QueryRunTimeHandler(int nResult, int nMode);
Through this callback, determine which VIVEPORT platform the VR title is intended for.
The
nResult
of this callback will return
0
when initialization is successful or
1
when initialization failed. The
nMode
will return
1
when the intended platform is VIVEPORT Desktop or
2
when it’s VIVEPORT Arcade.