GPUSurface


public final class GPUSurface implements AutoCloseable


An object representing a platform-specific surface for rendering.

Summary

Public methods

external void

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

final external void

Configures the surface for rendering.

boolean
equals(Object other)
final external @NonNull GPUSurfaceCapabilities

Retrieves 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
final external void

Presents the current texture to the user.

final external void

Sets a human-readable label for debugging.

final external void

Removes the configuration for the surface.

Public methods

close

Added in 1.0.0-alpha04
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

Added in 1.0.0-alpha04
@FastNative
public final external void configure(@NonNull GPUSurfaceConfiguration config)

Configures the surface for rendering.

Parameters
@NonNull GPUSurfaceConfiguration config

The new configuration for the surface.

equals

public boolean equals(Object other)

getCapabilities

Added in 1.0.0-alpha04
@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

Added in 1.0.0-alpha04
@FastNative
public final external @NonNull GPUSurfaceTexture getCurrentTexture()

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

getHandle

Added in 1.0.0-alpha04
public final long getHandle()

hashCode

public int hashCode()

present

Added in 1.0.0-alpha04
@FastNative
public final external void present()

Presents the current texture to the user.

Returns
void

The status of the operation.

setLabel

Added in 1.0.0-alpha04
@FastNative
public final external void setLabel(@NonNull String label)

Sets a human-readable label for debugging.

Parameters
@NonNull String label

The label string.

unconfigure

Added in 1.0.0-alpha04
@FastNative
public final external void unconfigure()

Removes the configuration for the surface.