GPUSurface
class GPUSurface : AutoCloseable
Represents a native window or display surface that can be drawn to.
Summary
Public functions |
|
|---|---|
open external Unit |
close() |
external Unit |
@FastNativeConfigures the surface with a device, format, size, and other options. |
open operator Boolean |
|
external SurfaceCapabilities |
@FastNativeGets 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 |
hashCode() |
external Unit |
Presents the currently acquired texture to the screen. |
external Unit |
@FastNativeSets a debug label for the surface. |
external Unit |
Unconfigures the surface, releasing the texture resources. |
Public functions
configure
@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. |
getCapabilities
@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
@FastNative
external fun getCurrentTexture(): SurfaceTexture
Gets the next available texture from the surface for rendering.
present
@FastNative
external fun present(): Unit
Presents the currently acquired texture to the screen.
| Returns | |
|---|---|
Unit |
Status code of the operation. |
setLabel
@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
@FastNative
external fun unconfigure(): Unit
Unconfigures the surface, releasing the texture resources.