C Specification
To create an XrSwapchain object and an Android Surface object call:
XrResult xrCreateSwapchainAndroidSurfaceKHR(
XrSession session,
const XrSwapchainCreateInfo* info,
XrSwapchain* swapchain,
jobject* surface);
Parameters
Description
xrCreateSwapchainAndroidSurfaceKHR creates an XrSwapchain object returned in swapchain
and an Android Surface jobject
returned in surface
.
The jobject
must be valid to be passed back to Java code using JNI and must be valid to be used
with ordinary Android APIs for submitting images to Surfaces.
The returned XrSwapchain must be valid to be referenced in XrSwapchainSubImage structures to show content on the screen.
The width and height passed in XrSwapchainCreateInfo may not be persistent throughout the life cycle of the created swapchain, since on Android,
the size of the images is controlled by the producer and possibly changes at any time.
The only function that is allowed to be called on the XrSwapchain returned from this function is xrDestroySwapchain. For example calling any of the functions xrEnumerateSwapchainImages, xrAcquireSwapchainImage, xrWaitSwapchainImage or xrReleaseSwapchainImage is invalid.
The XR runtime must destroy the provided Surface on calling xrDestroySwapchain. Applications writing frames to the Surface thereafter leads to undefined behavior.
xrCreateSwapchainAndroidSurfaceKHR must return the same set of error codes as xrCreateSwapchain under same circumstances plus XR_ERROR_FUNCTION_UNSUPPORTED
in case the function is not supported.
See Also
Document Notes
For more information, see the OpenXR Specification at URL
This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.