GPUSurface


class GPUSurface : AutoCloseable


An object representing a platform-specific surface for rendering.

Summary

Public functions

open external Unit

Decrements the reference count of the object and frees resources when the count reaches zero.

external Unit

Configures the surface for rendering.

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

Retrieves the capabilities of the surface for a given adapter.

external GPUSurfaceTexture

Gets the texture for the current frame to be rendered to.

open Int
external Unit

Presents the current texture to the user.

external Unit

Sets a human-readable label for debugging.

external Unit

Removes the configuration for the surface.

Public properties

Long

Public functions

close

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

Decrements the reference count of the object and frees resources when the count reaches zero.

This is the standard way to manage object lifetimes and should be used in use blocks. After calling this, the object is no longer usable.

configure

Added in 1.0.0-alpha04
@FastNative
external fun configure(config: GPUSurfaceConfiguration): Unit

Configures the surface for rendering.

Parameters
config: GPUSurfaceConfiguration

The new configuration for the surface.

equals

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

getCapabilities

Added in 1.0.0-alpha04
@FastNative
external fun getCapabilities(adapter: GPUAdapter): GPUSurfaceCapabilities

Retrieves the capabilities of the surface for a given adapter.

Parameters
adapter: GPUAdapter

The adapter to query capabilities for.

Returns
GPUSurfaceCapabilities

The status of the operation.

getCurrentTexture

Added in 1.0.0-alpha04
@FastNative
external fun getCurrentTexture(): GPUSurfaceTexture

Gets the texture for the current frame to be rendered to.

hashCode

open fun hashCode(): Int

present

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

Presents the current texture to the user.

Returns
Unit

The status of the operation.

setLabel

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

Sets a human-readable label for debugging.

Parameters
label: String

The label string.

unconfigure

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

Removes the configuration for the surface.

Public properties

handle

Added in 1.0.0-alpha04
val handleLong