GPUSurface
class GPUSurface : AutoCloseable
An object representing a platform-specific surface for rendering.
Summary
Public functions |
|
|---|---|
open external Unit |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
external Unit |
@FastNativeConfigures the surface for rendering. |
open operator Boolean |
|
external GPUSurfaceCapabilities |
@FastNativeRetrieves the capabilities of the surface for a given adapter. |
external GPUSurfaceTexture |
Gets the texture for the current frame to be rendered to. |
open Int |
hashCode() |
external Unit |
Presents the current texture to the user. |
external Unit |
@FastNativeSets a human-readable label for debugging. |
external Unit |
Removes the configuration for the surface. |
Public functions
close
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
@FastNative
external fun configure(config: GPUSurfaceConfiguration): Unit
Configures the surface for rendering.
| Parameters | |
|---|---|
config: GPUSurfaceConfiguration |
The new configuration for the surface. |
getCapabilities
@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
@FastNative
external fun getCurrentTexture(): GPUSurfaceTexture
Gets the texture for the current frame to be rendered to.
present
@FastNative
external fun present(): Unit
Presents the current texture to the user.
| Returns | |
|---|---|
Unit |
The status of the operation. |
setLabel
@FastNative
external fun setLabel(label: String): Unit
Sets a human-readable label for debugging.
| Parameters | |
|---|---|
label: String |
The label string. |
unconfigure
@FastNative
external fun unconfigure(): Unit
Removes the configuration for the surface.