openxr-0.1: Bindings to the OpenXR API
Safe HaskellNone
LanguageHaskell2010

OpenXR.Extensions.XR_KHR_android_surface_swapchain

Description

Name

XR_KHR_android_surface_swapchain - instance extension

Specification

See XR_KHR_android_surface_swapchain in the main specification for complete information.

Registered Extension Number

5

Revision

4

Extension and Version Dependencies

  • Requires OpenXR 1.0

See Also

createSwapchainAndroidSurfaceKHR

Document Notes

For more information, see the OpenXR Specification

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

createSwapchainAndroidSurfaceKHR Source #

Arguments

:: forall a io. (Extendss SwapchainCreateInfo a, PokeChain a, MonadIO io) 
=> Session

session is an Session handle previously created with createSession.

-> SwapchainCreateInfo a

info is a pointer to an SwapchainCreateInfo structure.

-> ("surface" ::: Ptr Jobject)

surface is a pointer to a jobject where the created Android Surface is returned.

-> io (Result, Swapchain) 

xrCreateSwapchainAndroidSurfaceKHR - Creates a swapchain and an Android Surface

Parameter Descriptions

Description

createSwapchainAndroidSurfaceKHR creates an Swapchain 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 Swapchain must be valid to be referenced in SwapchainSubImage structures to show content on the screen. The width and height passed in SwapchainCreateInfo 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 Swapchain returned from this function is destroySwapchain. For example, calling any of the functions enumerateSwapchainImages, acquireSwapchainImage, waitSwapchainImage or releaseSwapchainImage is invalid.

When the application receives the EventDataSessionStateChanged event with the SESSION_STATE_STOPPING state, it must ensure that no threads are writing to any of the Android surfaces created with this extension before calling endSession. The effect of writing frames to the Surface when the session is in states other than SESSION_STATE_VISIBLE or SESSION_STATE_FOCUSED is undefined.

createSwapchainAndroidSurfaceKHR must return the same set of error codes as createSwapchain under the same circumstances, plus ERROR_FUNCTION_UNSUPPORTED in case the function is not supported.

Valid Usage of SwapchainCreateInfo members

Valid Usage (Implicit)

  • session must be a valid Session handle
  • info must be a pointer to a valid SwapchainCreateInfo structure
  • swapchain must be a pointer to an Swapchain handle
  • surface must be a pointer to a jobject value

Return Codes

Success
Failure

See Also

Session, Swapchain, SwapchainCreateInfo, destroySwapchain

withSwapchainAndroidSurfaceKHR :: forall a io r. (Extendss SwapchainCreateInfo a, PokeChain a, MonadIO io) => Session -> SwapchainCreateInfo a -> Ptr Jobject -> (io (Result, Swapchain) -> ((Result, Swapchain) -> io ()) -> r) -> r Source #

A convenience wrapper to make a compatible pair of calls to createSwapchainAndroidSurfaceKHR and destroySwapchain

To ensure that destroySwapchain is always called: pass bracket (or the allocate function from your favourite resource management library) as the last argument. To just extract the pair pass (,) as the last argument.

type KHR_ANDROID_SURFACE_SWAPCHAIN_EXTENSION_NAME = "XR_KHR_android_surface_swapchain" Source #