NativeDataExt

Added in 1.0.0-alpha14

public final class NativeDataExt


Summary

Public methods

static final @NonNull NativeInstanceData

Returns a NativeInstanceData class containing pointers to native resources if available.

static final @NonNull NativeSessionData

Returns a NativeSessionData class containing pointers to native resources if available.

Public methods

getNativeInstanceData

@UnstableNativeResourceApi
public static final @NonNull NativeInstanceData getNativeInstanceData(@NonNull XrDevice receiver, @NonNull Context context)

Returns a NativeInstanceData class containing pointers to native resources if available. This is a dangerous API and can put the XR runtime in a bad state if used incorrectly.

The pointers are owned by the underlying runtime and should only be used to access APIs available in the native C spec for the relevant runtime. Applications should not trigger any lifecycle events on their own.

getNativeSessionData

@UnstableNativeResourceApi
public static final @NonNull NativeSessionData getNativeSessionData(@NonNull Session receiver)

Returns a NativeSessionData class containing pointers to native resources if available. This is a dangerous API and can put the XR Session in a bad state if used incorrectly.

The pointers are owned by the underlying runtime and should only be used to access APIs available in the native C spec for the relevant runtime. Applications should not trigger any lifecycle events on their own.

Throws
IllegalStateException

if the session is not using a runtime backed by a native session or the session has been destroyed.