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)Types
Cubemap face identifiers.
Pixel color format (how data is laid out in the client buffer for setImage()).
Internal texel format (how texels are stored in memory).
Describes pixel buffer data for uploading to a texture via setImage().
Sampler type for texture sampling.
Texture channel swizzle (maps channels to output RGBA).
Pixel data type (size and signedness of color components in the client buffer for setImage()).
Properties
Return this texture InternalFormat as set by Builder.format().
The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.
Return this texture Sampler as set by Builder.sampler().
Functions
Generates all mipmap levels automatically.
Returns whether this texture's creation is complete: always true unless the Builder was asynchronous.
Associates an external stream with this texture. Typically the external stream is OS-specific and can be a video or camera stream.
Updates a 2D texture level with image data from a buffer.
Updates a rectangular sub-region of a 2D texture level.
Updates a sub-region of a 3D texture or 2D texture array. Cubemaps are treated like a 2D array of six layers.
setImage, asynchronously: returns an ID for Engine.cancelAsyncCall, and callback runs once on the main thread with how it ended. Needs Engine.isAsynchronousModeEnabled.
setImage, asynchronously; see the level-only setImageAsync.