GPUSurface
public final class GPUSurface implements AutoCloseable
Represents a native window or display surface that can be drawn to.
Summary
Public methods |
|
|---|---|
external void |
close() |
final external void |
@FastNativeConfigures the surface with a device, format, size, and other options. |
boolean |
|
final external @NonNull SurfaceCapabilities |
@FastNativeGets the presentation capabilities supported by the surface for a given adapter. |
final external @NonNull SurfaceTexture |
Gets the next available texture from the surface for rendering. |
final long |
|
int |
hashCode() |
final external void |
Presents the currently acquired texture to the screen. |
final external void |
@FastNativeSets a debug label for the surface. |
final external void |
Unconfigures the surface, releasing the texture resources. |
Public methods
configure
@FastNative
public final external void configure(@NonNull SurfaceConfiguration config)
Configures the surface with a device, format, size, and other options.
| Parameters | |
|---|---|
@NonNull SurfaceConfiguration config |
The configuration settings for the surface. |
getCapabilities
@FastNative
public final external @NonNull SurfaceCapabilities getCapabilities(@NonNull GPUAdapter adapter)
Gets the presentation capabilities supported by the surface for a given adapter.
| Parameters | |
|---|---|
@NonNull GPUAdapter adapter |
The adapter used to query capabilities. |
| Returns | |
|---|---|
@NonNull SurfaceCapabilities |
Status code of the operation. |
getCurrentTexture
@FastNative
public final external @NonNull SurfaceTexture getCurrentTexture()
Gets the next available texture from the surface for rendering.
present
@FastNative
public final external void present()
Presents the currently acquired texture to the screen.
| Returns | |
|---|---|
void |
Status code of the operation. |
setLabel
@FastNative
public final external void setLabel(@NonNull String label)
Sets a debug label for the surface.
unconfigure
@FastNative
public final external void unconfigure()
Unconfigures the surface, releasing the texture resources.