// %BANNER_BEGIN%
// ---------------------------------------------------------------------
// %COPYRIGHT_BEGIN%
// Copyright (c) (2018-2023) Magic Leap, Inc. All Rights Reserved.
// Use of this file is governed by the Software License Agreement, located here: https://www.magicleap.com/software-license-agreement-ml2
// Terms and conditions applicable to third-party materials accompanying this distribution may also be found in the top-level NOTICE file appearing herein.
// %COPYRIGHT_END%
// ---------------------------------------------------------------------
// %BANNER_END%
namespace UnityEngine.XR.MagicLeap
{
using System;
using System.Runtime.InteropServices;
public partial class MLSpace
{
///
/// See ml_space.h for additional comments.
///
public class NativeBindings : Native.MagicLeapNativeBindings
{
///
/// Creates a Magic Leap Space manager handle.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceManagerCreate(in Settings settings, out ulong handle);
///
/// Set the callbacks for events related to the Magic Leap Space.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceSetCallbacks(ulong handle, ref SpaceCallbacks callbacks, IntPtr userData );
///
/// The list memory is owned by the library, call #MLSpaceReleaseSpaceList to
/// release the memory. Each get #MLSpaceGetSpaceList should have a corresponding
/// #MLSpaceReleaseSpaceList.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceGetSpaceList(ulong hanlde, out SpaceFilter queryFilter, out SpaceList spaceList);
///
/// Release the list of available spaces.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceReleaseSpaceList(ulong handle, out SpaceList list);
///
/// Send a request to localize to a given Magic Leap Space.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceRequestLocalization(ulong handle, ref SpaceLocalizationInfo spaceList);
///
/// Get the localization results.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceGetLocalizationResult(ulong handle, out SpaceLocalizationResult result);
///
/// Destroys a Space manager handle.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceManagerDestroy(ulong handle);
///
/// The #MLSpaceImportInfo memory is owned by the app and the app should make sure
/// to release the memory once the API call has returned
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceImportSpace(in SpaceImportInfo importInfo, ref SpaceImportOutData data);
///
/// Export an on device Magic Leap Space.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceExportSpace(in SpaceExportInfo exportInfo, ref SpaceExportOutData data);
///
/// Release resources acquired in #MLSpaceExportSpace.
///
[DllImport(MLSpaceDll, CallingConvention = CallingConvention.Cdecl)]
public static extern MLResult.Code MLSpaceReleaseExportData(ref SpaceExportOutData data);
}
}
}