Texture

actual class Texture

Texture represents a GPU texture resource.

The Texture class supports:

  • 2D textures

  • 3D textures

  • Cube maps

  • Mip mapping

Creation and destruction

========================

A Texture object is created using the Texture.Builder and destroyed by calling Engine.destroy(texture).

val engine = Engine.create()

val texture = Texture.Builder()
.width(64)
.height(64)
.build(engine)

engine.destroy(texture)
expect class Texture

Texture represents a GPU texture resource.

The Texture class supports:

  • 2D textures

  • 3D textures

  • Cube maps

  • Mip mapping

Creation and destruction

========================

A Texture object is created using the Texture.Builder and destroyed by calling Engine.destroy(texture).

val engine = Engine.create()

val texture = Texture.Builder()
.width(64)
.height(64)
.build(engine)

engine.destroy(texture)
actual class Texture

Texture represents a GPU texture resource.

The Texture class supports:

  • 2D textures

  • 3D textures

  • Cube maps

  • Mip mapping

Creation and destruction

========================

A Texture object is created using the Texture.Builder and destroyed by calling Engine.destroy(texture).

val engine = Engine.create()

val texture = Texture.Builder()
.width(64)
.height(64)
.build(engine)

engine.destroy(texture)
actual class Texture

Texture represents a GPU texture resource.

The Texture class supports:

  • 2D textures

  • 3D textures

  • Cube maps

  • Mip mapping

Creation and destruction

========================

A Texture object is created using the Texture.Builder and destroyed by calling Engine.destroy(texture).

val engine = Engine.create()

val texture = Texture.Builder()
.width(64)
.height(64)
.build(engine)

engine.destroy(texture)
actual class Texture

Texture represents a GPU texture resource.

The Texture class supports:

  • 2D textures

  • 3D textures

  • Cube maps

  • Mip mapping

Creation and destruction

========================

A Texture object is created using the Texture.Builder and destroyed by calling Engine.destroy(texture).

val engine = Engine.create()

val texture = Texture.Builder()
.width(64)
.height(64)
.build(engine)

engine.destroy(texture)

Constructors

Link copied to clipboard
constructor(nativeTexture: Texture)
constructor(jsTexture: Texture)
constructor(nativeHandle: MemorySegment?)
constructor(nativeHandle: CPointer<FilaTexture>?)

Types

Link copied to clipboard
actual class Builder

Builder for creating Texture instances.

expect class Builder

Builder for creating Texture instances.

actual class Builder

Builder for creating Texture instances.

actual class Builder

Builder for creating Texture instances.

actual class Builder

Builder for creating Texture instances.

Link copied to clipboard
actual object Companion
expect object Companion
actual object Companion
actual object Companion
actual object Companion
Link copied to clipboard

Cubemap face identifiers.

Cubemap face identifiers.

Cubemap face identifiers.

Cubemap face identifiers.

Cubemap face identifiers.

Link copied to clipboard
actual enum Format : Enum<Texture.Format>

Pixel color format (how data is laid out in the client buffer for setImage()).

expect enum Format : Enum<Texture.Format>

Pixel color format (how data is laid out in the client buffer for setImage()).

actual enum Format : Enum<Texture.Format>

Pixel color format (how data is laid out in the client buffer for setImage()).

actual enum Format : Enum<Texture.Format>

Pixel color format (how data is laid out in the client buffer for setImage()).

actual enum Format : Enum<Texture.Format>

Pixel color format (how data is laid out in the client buffer for setImage()).

Link copied to clipboard

Internal texel format (how texels are stored in memory).

Internal texel format (how texels are stored in memory).

Internal texel format (how texels are stored in memory).

Internal texel format (how texels are stored in memory).

Internal texel format (how texels are stored in memory).

Link copied to clipboard
actual class PixelBufferDescriptor(val storage: ByteArray, val sizeInBytes: Int, val format: Texture.Format, val type: Texture.Type, val alignment: Int, val left: Int, val top: Int, val stride: Int, val callback: () -> Unit?)

Describes pixel buffer data for uploading to a texture via setImage().

expect class PixelBufferDescriptor(storage: ByteArray, sizeInBytes: Int, format: Texture.Format, type: Texture.Type, alignment: Int = 1, left: Int = 0, top: Int = 0, stride: Int = 0, callback: () -> Unit? = null)

Describes pixel buffer data for uploading to a texture via setImage().

actual class PixelBufferDescriptor(val storage: ByteArray, val sizeInBytes: Int, val format: Texture.Format, val type: Texture.Type, val alignment: Int, val left: Int, val top: Int, val stride: Int, val callback: () -> Unit?)

Describes pixel buffer data for uploading to a texture via setImage().

actual class PixelBufferDescriptor(val storage: ByteArray, val sizeInBytes: Int, val format: Texture.Format, val type: Texture.Type, val alignment: Int, val left: Int, val top: Int, val stride: Int, val callback: () -> Unit?)

Describes pixel buffer data for uploading to a texture via setImage().

actual class PixelBufferDescriptor(val storage: ByteArray, val sizeInBytes: Int, val format: Texture.Format, val type: Texture.Type, val alignment: Int, val left: Int, val top: Int, val stride: Int, val callback: () -> Unit?)

Describes pixel buffer data for uploading to a texture via setImage().

Link copied to clipboard
actual enum Sampler : Enum<Texture.Sampler>

Sampler type for texture sampling.

expect enum Sampler : Enum<Texture.Sampler>

Sampler type for texture sampling.

actual enum Sampler : Enum<Texture.Sampler>

Sampler type for texture sampling.

actual enum Sampler : Enum<Texture.Sampler>

Sampler type for texture sampling.

actual enum Sampler : Enum<Texture.Sampler>

Sampler type for texture sampling.

Link copied to clipboard
actual enum Swizzle : Enum<Texture.Swizzle>

Texture channel swizzle (maps channels to output RGBA).

expect enum Swizzle : Enum<Texture.Swizzle>

Texture channel swizzle (maps channels to output RGBA).

actual enum Swizzle : Enum<Texture.Swizzle>

Texture channel swizzle (maps channels to output RGBA).

actual enum Swizzle : Enum<Texture.Swizzle>

Texture channel swizzle (maps channels to output RGBA).

actual enum Swizzle : Enum<Texture.Swizzle>

Texture channel swizzle (maps channels to output RGBA).

Link copied to clipboard
actual enum Type : Enum<Texture.Type>

Pixel data type (size and signedness of color components in the client buffer for setImage()).

expect enum Type : Enum<Texture.Type>

Pixel data type (size and signedness of color components in the client buffer for setImage()).

actual enum Type : Enum<Texture.Type>

Pixel data type (size and signedness of color components in the client buffer for setImage()).

actual enum Type : Enum<Texture.Type>

Pixel data type (size and signedness of color components in the client buffer for setImage()).

actual enum Type : Enum<Texture.Type>

Pixel data type (size and signedness of color components in the client buffer for setImage()).

Link copied to clipboard
actual class Usage

Texture usage flags affecting memory layout and capabilities.

expect class Usage

Texture usage flags affecting memory layout and capabilities.

actual class Usage

Texture usage flags affecting memory layout and capabilities.

actual class Usage

Texture usage flags affecting memory layout and capabilities.

actual class Usage

Texture usage flags affecting memory layout and capabilities.

Properties

Link copied to clipboard
val jsTexture: Texture
Link copied to clipboard
var nativeHandle: MemorySegment?
var nativeHandle: CPointer<FilaTexture>?
Link copied to clipboard
val nativeTexture: Texture

Functions

Link copied to clipboard
actual fun generateMipmaps(engine: Engine)

Generates all mipmap levels automatically.

expect fun generateMipmaps(engine: Engine)

Generates all mipmap levels automatically.

actual fun generateMipmaps(engine: Engine)

Generates all mipmap levels automatically.

actual fun generateMipmaps(engine: Engine)

Generates all mipmap levels automatically.

actual fun generateMipmaps(engine: Engine)

Generates all mipmap levels automatically.

Link copied to clipboard
actual fun getDepth(level: Int): Int

Returns the depth of a 3D texture level.

expect fun getDepth(level: Int = 0): Int

Returns the depth of a 3D texture level.

actual fun getDepth(level: Int): Int

Returns the depth of a 3D texture level.

actual fun getDepth(level: Int): Int

Returns the depth of a 3D texture level.

actual fun getDepth(level: Int): Int

Returns the depth of a 3D texture level.

Link copied to clipboard

Return this texture InternalFormat as set by Builder.format().

Return this texture InternalFormat as set by Builder.format().

Return this texture InternalFormat as set by Builder.format().

Return this texture InternalFormat as set by Builder.format().

Return this texture InternalFormat as set by Builder.format().

Link copied to clipboard
actual fun getHeight(level: Int): Int

Returns the height of a 2D or 3D texture level.

expect fun getHeight(level: Int = 0): Int

Returns the height of a 2D or 3D texture level.

actual fun getHeight(level: Int): Int

Returns the height of a 2D or 3D texture level.

actual fun getHeight(level: Int): Int

Returns the height of a 2D or 3D texture level.

actual fun getHeight(level: Int): Int

Returns the height of a 2D or 3D texture level.

Link copied to clipboard
actual fun getLevels(): Int

Returns the maximum number of levels this texture can have.

expect fun getLevels(): Int

Returns the maximum number of levels this texture can have.

actual fun getLevels(): Int

Returns the maximum number of levels this texture can have.

actual fun getLevels(): Int

Returns the maximum number of levels this texture can have.

actual fun getLevels(): Int

Returns the maximum number of levels this texture can have.

Link copied to clipboard

Return this texture Sampler as set by Builder.sampler().

Return this texture Sampler as set by Builder.sampler().

Return this texture Sampler as set by Builder.sampler().

Return this texture Sampler as set by Builder.sampler().

Return this texture Sampler as set by Builder.sampler().

Link copied to clipboard
actual fun getWidth(level: Int): Int

Returns the width of a 2D or 3D texture level.

expect fun getWidth(level: Int = 0): Int

Returns the width of a 2D or 3D texture level.

actual fun getWidth(level: Int): Int

Returns the width of a 2D or 3D texture level.

actual fun getWidth(level: Int): Int

Returns the width of a 2D or 3D texture level.

actual fun getWidth(level: Int): Int

Returns the width of a 2D or 3D texture level.

Link copied to clipboard
actual fun setExternalStream(engine: Engine, stream: Stream)

Associates an external stream with this texture. Typically the external stream is OS-specific and can be a video or camera stream.

expect fun setExternalStream(engine: Engine, stream: Stream)

Associates an external stream with this texture. Typically the external stream is OS-specific and can be a video or camera stream.

actual fun setExternalStream(engine: Engine, stream: Stream)

Associates an external stream with this texture. Typically the external stream is OS-specific and can be a video or camera stream.

actual fun setExternalStream(engine: Engine, stream: Stream)

Associates an external stream with this texture. Typically the external stream is OS-specific and can be a video or camera stream.

actual fun setExternalStream(engine: Engine, stream: Stream)

Associates an external stream with this texture. Typically the external stream is OS-specific and can be a video or camera stream.

Link copied to clipboard
actual fun setImage(engine: Engine, level: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a 2D texture level with image data from a buffer.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a rectangular sub-region of a 2D texture level.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, zoffset: Int, width: Int, height: Int, depth: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a sub-region of a 3D texture or 2D texture array. Cubemaps are treated like a 2D array of six layers.

expect fun setImage(engine: Engine, level: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a 2D texture level with image data from a buffer.

expect fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a rectangular sub-region of a 2D texture level.

expect fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, zoffset: Int, width: Int, height: Int, depth: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a sub-region of a 3D texture or 2D texture array. Cubemaps are treated like a 2D array of six layers.

actual fun setImage(engine: Engine, level: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a 2D texture level with image data from a buffer.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a rectangular sub-region of a 2D texture level.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, zoffset: Int, width: Int, height: Int, depth: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a sub-region of a 3D texture or 2D texture array. Cubemaps are treated like a 2D array of six layers.

actual fun setImage(engine: Engine, level: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a 2D texture level with image data from a buffer.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a rectangular sub-region of a 2D texture level.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, zoffset: Int, width: Int, height: Int, depth: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a sub-region of a 3D texture or 2D texture array. Cubemaps are treated like a 2D array of six layers.

actual fun setImage(engine: Engine, level: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a 2D texture level with image data from a buffer.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a rectangular sub-region of a 2D texture level.

actual fun setImage(engine: Engine, level: Int, xoffset: Int, yoffset: Int, zoffset: Int, width: Int, height: Int, depth: Int, descriptor: Texture.PixelBufferDescriptor)

Updates a sub-region of a 3D texture or 2D texture array. Cubemaps are treated like a 2D array of six layers.