GPUTexture
public final class GPUTexture implements AutoCloseable
A GPU texture object.
Summary
Public methods |
|
|---|---|
external void |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
final external @NonNull GPUTextureView |
@FastNativeCreates a new view of the texture. |
final int |
|
final external void |
Destroys the texture and releases its resources. |
final int |
|
boolean |
|
final int |
format() |
final external int |
Gets the depth or number of array layers of the texture. |
final external int |
Gets the dimension of the texture. |
final external int |
Gets the format of the texture. |
final long |
|
final external int |
Gets the height of the texture. |
final external int |
Gets the number of mipmap levels of the texture. |
final external int |
Gets the sample count of the texture. |
final external int |
|
final external int |
Gets the allowed usages of the texture. |
final external int |
Gets the width of the texture. |
int |
hashCode() |
final int |
height() |
final int |
|
final int |
|
final external void |
@FastNativeSets a human-readable label for debugging. |
final int |
|
final int |
usage() |
final int |
width() |
Extension functions |
|
|---|---|
final @NonNull Bitmap |
TexturesUtils.createBitmap( |
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.
createView
@FastNative
public final external @NonNull GPUTextureView createView(GPUTextureViewDescriptor descriptor)
Creates a new view of the texture.
| Parameters | |
|---|---|
GPUTextureViewDescriptor descriptor |
The descriptor for the texture view. |
| Returns | |
|---|---|
@NonNull GPUTextureView |
The created texture view. |
destroy
@FastNative
public final external void destroy()
Destroys the texture and releases its resources.
getDepthOrArrayLayers
@FastNative
public final external int getDepthOrArrayLayers()
Gets the depth or number of array layers of the texture.
| Returns | |
|---|---|
int |
The texture depth or layer count. |
getDimension
@FastNative
public final external int getDimension()
Gets the dimension of the texture.
| Returns | |
|---|---|
int |
The texture dimension. |
getFormat
@FastNative
public final external int getFormat()
Gets the format of the texture.
| Returns | |
|---|---|
int |
The texture format. |
getHeight
@FastNative
public final external int getHeight()
Gets the height of the texture.
| Returns | |
|---|---|
int |
The texture height. |
getMipLevelCount
@FastNative
public final external int getMipLevelCount()
Gets the number of mipmap levels of the texture.
| Returns | |
|---|---|
int |
The mipmap level count. |
getSampleCount
@FastNative
public final external int getSampleCount()
Gets the sample count of the texture.
| Returns | |
|---|---|
int |
The sample count. |
getTextureBindingViewDimension
@FastNative
public final external int getTextureBindingViewDimension()
getUsage
@FastNative
public final external int getUsage()
Gets the allowed usages of the texture.
| Returns | |
|---|---|
int |
The texture usage flags. |
getWidth
@FastNative
public final external int getWidth()
Gets the width of the texture.
| Returns | |
|---|---|
int |
The texture width. |
setLabel
@FastNative
public final external void setLabel(@NonNull String label)
Sets a human-readable label for debugging.
Extension functions
TexturesUtils.createBitmap
public final @NonNull Bitmap TexturesUtils.createBitmap(
@NonNull GPUTexture receiver,
@NonNull GPUDevice device
)