GPUTexture
class GPUTexture : AutoCloseable
A GPU texture object.
Summary
Public functions |
|
|---|---|
open external Unit |
close()Decrements the reference count of the object and frees resources when the count reaches zero. |
external GPUTextureView |
@FastNativeCreates a new view of the texture. |
external Unit |
Destroys the texture and releases its resources. |
open operator Boolean |
|
external Int |
Gets the depth or number of array layers of the texture. |
external Int |
Gets the dimension of the texture. |
external Int |
Gets the format of the texture. |
external Int |
Gets the height of the texture. |
external Int |
Gets the number of mipmap levels of the texture. |
external Int |
Gets the sample count of the texture. |
external Int |
|
external Int |
Gets the allowed usages of the texture. |
external Int |
Gets the width of the texture. |
open Int |
hashCode() |
external Unit |
@FastNativeSets a human-readable label for debugging. |
Extension functions |
|
|---|---|
suspend Bitmap |
GPUTexture.createBitmap(device: GPUDevice) |
Public functions
close
open external fun close(): Unit
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
external fun createView(descriptor: GPUTextureViewDescriptor? = null): GPUTextureView
Creates a new view of the texture.
| Parameters | |
|---|---|
descriptor: GPUTextureViewDescriptor? = null |
The descriptor for the texture view. |
| Returns | |
|---|---|
GPUTextureView |
The created texture view. |
destroy
@FastNative
external fun destroy(): Unit
Destroys the texture and releases its resources.
getDepthOrArrayLayers
@FastNative
external fun getDepthOrArrayLayers(): Int
Gets the depth or number of array layers of the texture.
| Returns | |
|---|---|
Int |
The texture depth or layer count. |
getDimension
@FastNative
external fun getDimension(): Int
Gets the dimension of the texture.
| Returns | |
|---|---|
Int |
The texture dimension. |
getFormat
@FastNative
external fun getFormat(): Int
Gets the format of the texture.
| Returns | |
|---|---|
Int |
The texture format. |
getHeight
@FastNative
external fun getHeight(): Int
Gets the height of the texture.
| Returns | |
|---|---|
Int |
The texture height. |
getMipLevelCount
@FastNative
external fun getMipLevelCount(): Int
Gets the number of mipmap levels of the texture.
| Returns | |
|---|---|
Int |
The mipmap level count. |
getSampleCount
@FastNative
external fun getSampleCount(): Int
Gets the sample count of the texture.
| Returns | |
|---|---|
Int |
The sample count. |
getTextureBindingViewDimension
@FastNative
external fun getTextureBindingViewDimension(): Int
getUsage
@FastNative
external fun getUsage(): Int
Gets the allowed usages of the texture.
| Returns | |
|---|---|
Int |
The texture usage flags. |
getWidth
@FastNative
external fun getWidth(): Int
Gets the width of the texture.
| Returns | |
|---|---|
Int |
The texture width. |
setLabel
@FastNative
external fun setLabel(label: String): Unit
Sets a human-readable label for debugging.
| Parameters | |
|---|---|
label: String |
The label string. |
Public properties
Extension functions
GPUTexture.createBitmap
suspend fun GPUTexture.createBitmap(device: GPUDevice): Bitmap