API reference
API reference
Select your platform
No SDKs available
No versions available

SceneSwapchain Class

Modifiers: final
Represents a swapchain for rendering Layers. Multiple SceneLayers can sample from a single SceneSwapchain
A swapchain is a collection of buffers used for rendering in graphics APIs. It manages the presentation of rendered content to the display and provides surfaces that can be used for drawing.

Signature

class SceneSwapchain

Constructors

SceneSwapchain ( handle ) : SceneSwapchain
Signature
constructor(handle: Long)
Parameters
handle: Long

Properties

handle : Long
[Get]
Signature
var handle: Long

Functions

destroy ()
Signature
fun destroy()
getSurface () : Surface?
Gets the Android Surface associated with this swapchain.
The returned Surface can be used for drawing content that will be displayed through this swapchain.
Signature
fun getSurface(): Surface?
Returns
Surface?
The Android Surface for drawing, or null if no surface is available
nativeHandle () : Long
Signature
fun nativeHandle(): Long
Returns
Long
platformHandle () : Long
Signature
fun platformHandle(): Long
Returns
Long
updateSampler ( sampler )
Updates the sampler configuration for this swapchain.
The sampler controls how textures are filtered and addressed when rendered.
Signature
fun updateSampler(sampler: SamplerConfig)
Parameters
sampler: SamplerConfig
The sampler configuration to apply

Companion Object

Companion Object Functions

create ( width , height , numberOfMips ) : SceneSwapchain
Creates a standard swapchain for rendering.
This type of swapchain is suitable for general rendering purposes and can be used with SceneLayer objects.
Signature
fun create(width: Int, height: Int, numberOfMips: Int): SceneSwapchain
Parameters
width: Int
Width of the swapchain in pixels
height: Int
Height of the swapchain in pixels
numberOfMips: Int
Number of mipmap levels to generate (1 for no mipmaps)
Returns
A new standard swapchain
createAsAndroid ( width , height , isProtected ) : SceneSwapchain
Creates a swapchain that is automatically updated when the associated Android Surface is updated. This is what is used in "direct-to-compositor" layer Panels and will be used when you do not require a SceneTexture. It is generally a more performant option and optionally allows for secure/DRM content to be played.
Signature
fun createAsAndroid(width: Int, height: Int, isProtected: Boolean = false): SceneSwapchain
Parameters
width: Int
Width of the swapchain in pixels
height: Int
Height of the swapchain in pixels
isProtected: Boolean
Whether the swapchain should use protected content. This is a requirement for DRM.
Returns
A new Android-compatible swapchain
Did you find this page helpful?
Thumbs up icon
Thumbs down icon