GPUSurface


class GPUSurface : AutoCloseable


Represents a native window or display surface that can be drawn to.

Summary

Public functions

open external Unit
external Unit

Configures the surface with a device, format, size, and other options.

open operator Boolean
equals(other: Any?)
external SurfaceCapabilities

Gets the presentation capabilities supported by the surface for a given adapter.

external SurfaceTexture

Gets the next available texture from the surface for rendering.

open Int
external Unit

Presents the currently acquired texture to the screen.

external Unit

Sets a debug label for the surface.

external Unit

Unconfigures the surface, releasing the texture resources.

Public properties

Long

Public functions

close

Added in 1.0.0-alpha01
open external fun close(): Unit

configure

Added in 1.0.0-alpha01
@FastNative
external fun configure(config: SurfaceConfiguration): Unit

Configures the surface with a device, format, size, and other options.

Parameters
config: SurfaceConfiguration

The configuration settings for the surface.

equals

open operator fun equals(other: Any?): Boolean

getCapabilities

Added in 1.0.0-alpha01
@FastNative
external fun getCapabilities(adapter: GPUAdapter): SurfaceCapabilities

Gets the presentation capabilities supported by the surface for a given adapter.

Parameters
adapter: GPUAdapter

The adapter used to query capabilities.

Returns
SurfaceCapabilities

Status code of the operation.

getCurrentTexture

Added in 1.0.0-alpha01
@FastNative
external fun getCurrentTexture(): SurfaceTexture

Gets the next available texture from the surface for rendering.

hashCode

open fun hashCode(): Int

present

Added in 1.0.0-alpha01
@FastNative
external fun present(): Unit

Presents the currently acquired texture to the screen.

Returns
Unit

Status code of the operation.

setLabel

Added in 1.0.0-alpha01
@FastNative
external fun setLabel(label: String): Unit

Sets a debug label for the surface.

Parameters
label: String

The label to assign to the surface.

unconfigure

Added in 1.0.0-alpha01
@FastNative
external fun unconfigure(): Unit

Unconfigures the surface, releasing the texture resources.

Public properties

handle

Added in 1.0.0-alpha01
val handleLong