GPUSurface
public final class GPUSurface implements AutoCloseable
An object representing a platform-specific surface for rendering.
Summary
Public methods |
|
|---|---|
external void |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
final external void |
Configures the surface for rendering. |
boolean |
|
final external @NonNull GPUSurfaceCapabilities |
@FastNativeRetrieves the capabilities of the surface for a given adapter. |
final external @NonNull GPUSurfaceTexture |
Gets the texture for the current frame to be rendered to. |
final long |
|
int |
hashCode() |
final external void |
Presents the current texture to the user. |
final external void |
@FastNativeSets a human-readable label for debugging. |
final external void |
Removes the configuration for the surface. |
Public methods
close
public external void close()
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
public final external void configure(@NonNull GPUSurfaceConfiguration config)
Configures the surface for rendering.
| Parameters | |
|---|---|
@NonNull GPUSurfaceConfiguration config |
The new configuration for the surface. |
getCapabilities
@FastNative
public final external @NonNull GPUSurfaceCapabilities getCapabilities(@NonNull GPUAdapter adapter)
Retrieves the capabilities of the surface for a given adapter.
| Parameters | |
|---|---|
@NonNull GPUAdapter adapter |
The adapter to query capabilities for. |
| Returns | |
|---|---|
@NonNull GPUSurfaceCapabilities |
The status of the operation. |
getCurrentTexture
@FastNative
public final external @NonNull GPUSurfaceTexture getCurrentTexture()
Gets the texture for the current frame to be rendered to.
present
@FastNative
public final external void present()
Presents the current texture to the user.
| Returns | |
|---|---|
void |
The status of the operation. |
setLabel
@FastNative
public final external void setLabel(@NonNull String label)
Sets a human-readable label for debugging.
unconfigure
@FastNative
public final external void unconfigure()
Removes the configuration for the surface.