Skip to main content
Version: 20 Mar 2024

ZI

APIs for the Zero Iteration on Host OS Platforms. More...

Functions

Name
MLResultMLZIIsServerConfigured(bool * out_is_configured)
Checks to see if the Zero Iteration server is running and configured properly to use by a host application.
MLResultMLZISetProgramLabel(const char * in_label)
Set the human-readable label of the current project or library, to be used in UI display and diagnostic logs to indicate what is running.
MLResultMLZIGraphicsEnumerateRequiredVkInstanceExtensions(VkExtensionProperties out_required_extension_properties, uint32_t out_extension_property_count)
Returns a list of required VkInstance extensions.
MLResultMLZIGraphicsEnumerateRequiredVkDeviceExtensions(VkExtensionProperties out_required_extension_properties, uint32_t out_extension_property_count)
Returns a list of required VkDevice extensions.
MLResultMLZIPermissionsStart()
Start the ZI permissions system. This must be called before other permissions calls.
MLResultMLZIPermissionsStop()
Stop the ZI permission system. Call to clean up the ZI permission system at application termination.
MLResultMLZIPermissionsIsGranted(const char * permission_name)
Asks if the application has the given permission granted.
MLResultMLZIPermissionsRequest(const char * permission_name)
Request the given permission (blocking if pending until user either allows or denies permission). Client code can poll the permission state to see if the permission was granted, denied or still pending.

Detailed Description

APIs for the Zero Iteration on Host OS Platforms.

  • This header supports general Zero Iteation state queries.
  • Provides ZI support for host-specific MLGraphics APIs.
  • These APIs support requesting and checking permissions from the C API rather than requiring ZI to emulate a full JNI layer. Programs should conditionally use these APIs when building for host instead of using Android APIs in order to simulate permissions requests and management.
Attention
  • These APIs are meant to enable a better integration to ZI for engines running on Host OS Platforms. These APIs are not available on device.
  • These APIs are meant to enable a better integration to ZI for engines running on Host OS Platforms. These APIs are not available on device.
  • These APIs are meant to enable a better integration to ZI for engines running on Host OS Platforms. These APIs are not available on device.

Shared Object:

  • zi.magicleap*

Shared Object:

  • graphics.magicleap*

Shared Object:

  • zi.magicleap*

Functions Documentation

MLZIIsServerConfigured

MLResult MLZIIsServerConfigured(
bool * out_is_configured
)

Checks to see if the Zero Iteration server is running and configured properly to use by a host application.

Parameters

bool *out_is_configuredPointer to a bool indicating whether the ZI server is running and is configured properly.

Returns

MLResultMLResult_InvalidParamis_configured parameter is not valid (null).
MLResultMLResult_OkIf query was successful.
MLResultMLResult_TimeoutThe ZI server could not be reached.
MLResultMLResult_UnspecifiedFailureThere was an unknown error submitting the query.

Required Permissions:

  • None

API Level:

  • 20

MLZISetProgramLabel

MLResult MLZISetProgramLabel(
const char * in_label
)

Set the human-readable label of the current project or library, to be used in UI display and diagnostic logs to indicate what is running.

Parameters

const char *in_labelPointer to a C string indicating the label to use for the running program, or NULL or "" to reset the label. The string is copied. It is interpreted as UTF-8.

Returns

MLResultMLResult_OkIf label was accepted (always).

Required Permissions:

  • None

When unset, The Lab and the ZI runtime refer to a program running under ZI by its process / executable name.

A label must be set before the program calls one of the MLGraphicsCreate() functions in order to be reflected.

API Level:

  • 20

MLZIGraphicsEnumerateRequiredVkInstanceExtensions

MLResult MLZIGraphicsEnumerateRequiredVkInstanceExtensions(
VkExtensionProperties * out_required_extension_properties,
uint32_t * out_extension_property_count
)

Returns a list of required VkInstance extensions.

Parameters

VkExtensionProperties *out_required_extension_propertiesEither null or a pointer to an array of VkExtensionProperties.
uint32_t *out_extension_property_countIs a pointer to an integer related to the number of extensions required or queried.

Returns

MLResultMLResult_InvalidParamIf input parameter is invalid.
MLResultMLResult_OkIf query was successful.
MLResultMLResult_UnspecifiedFailureThere was an unknown error submitting the query.

Required Permissions:

  • None

If out_required_extension_properties is null then the number of required extension is returned in out_extension_property_count. Otherwise, out_extension_property_count must point to a variable set to the number of elements in the out_required_extension_properties array, and on return the variable is overwritten with the number of strings actually written to out_required_extension_properties.


MLZIGraphicsEnumerateRequiredVkDeviceExtensions

MLResult MLZIGraphicsEnumerateRequiredVkDeviceExtensions(
VkExtensionProperties * out_required_extension_properties,
uint32_t * out_extension_property_count
)

Returns a list of required VkDevice extensions.

Parameters

VkExtensionProperties *out_required_extension_propertiesEither null or a pointer to an array of VkExtensionProperties.
uint32_t *out_extension_property_countIs a pointer to an integer related to the number of extensions required or queried.

Returns

MLResultMLResult_InvalidParamIf input parameter is invalid.
MLResultMLResult_OkIf query was successful.
MLResultMLResult_UnspecifiedFailureThere was an unknown error submitting the query.

Required Permissions:

  • None

If out_required_extension_properties is null then the number of required extension is returned in out_extension_property_count. Otherwise, out_extension_property_count must point to a variable set to the number of elements in the out_required_extension_properties array, and on return the variable is overwritten with the number of strings actually written to out_required_extension_properties.


MLZIPermissionsStart

MLResult MLZIPermissionsStart()

Start the ZI permissions system. This must be called before other permissions calls.

Returns

MLResultMLResult_OkIf query was successful.
MLResultMLResult_UnspecifiedFailureThere was an unknown error.

Required Permissions:

  • None

API Level:

  • 20

MLZIPermissionsStop

MLResult MLZIPermissionsStop()

Stop the ZI permission system. Call to clean up the ZI permission system at application termination.

Returns

MLResultMLResult_OkIf query was successful.
MLResultMLResult_UnspecifiedFailureThere was an unknown error.

Required Permissions:

  • None

API Level:

  • 20

MLZIPermissionsIsGranted

MLResult MLZIPermissionsIsGranted(
const char * permission_name
)

Asks if the application has the given permission granted.

Parameters

const char *permission_nameThe permission name.

Returns

MLResultMLResult_InvalidParamThe permission_name parameter is not valid (or null).
MLResultMLResult_OkThe permission is granted.
MLResultMLResult_PermissionDeniedIf permission denied.
MLResultMLResult_PendingIf permission request has not been resolved.
MLResultMLResult_UnspecifiedFailureThere was an unknown error.

Required Permissions:

  • Any

See: https://developer.android.com/training/permissions/requesting

API Level:

  • 20

MLZIPermissionsRequest

MLResult MLZIPermissionsRequest(
const char * permission_name
)

Request the given permission (blocking if pending until user either allows or denies permission). Client code can poll the permission state to see if the permission was granted, denied or still pending.

Parameters

const char *permission_nameThe permission name.

Returns

MLResultMLResult_InvalidParamThe permission_name parameter is not valid (or null).
MLResultMLResult_OkThe query was successful.
MLResultMLResult_UnspecifiedFailureThere was an unknown error.

Required Permissions:

  • None

See: https://developer.android.com/training/permissions/requesting

API Level:

  • 20