Texture

class Texture(val textureData: TextureData) : Preparable, Disposable

Author

Colton Daily

Constructors

Link copied to clipboard
fun Texture(textureData: TextureData)

Functions

Link copied to clipboard
fun bind(unit: Int = 0)

Binds this texture to the given texture unit. Sets the currently active texture via GL.activeTexture

Link copied to clipboard
open override fun dispose()
Link copied to clipboard
open override fun prepare(context: Context)

Prepares the texture for the Context. Sets this Textures GL context to the passed in application.

Properties

Link copied to clipboard
var glTexture: GlTexture? = null
Link copied to clipboard
val height: Int
Link copied to clipboard

Sets the TexMagFilter for this texture for magnification. This will bind the texture if the texture has been loaded.

Link copied to clipboard

Sets the TexMinFilter for this texture for minification. This will bind the texture if the texture has been loaded.

Link copied to clipboard
open override val prepared: Boolean
Link copied to clipboard
Link copied to clipboard

Sets the TexWrap for this texture on the S axis. This will bind the texture if the texture has been loaded.

Link copied to clipboard

Sets the TexWrap for this texture on the V axis. This will bind the texture if the texture has been loaded.

Link copied to clipboard
val width: Int

Extensions

Link copied to clipboard
fun Texture.addBorderToSlices(context: Context, sliceWidth: Int, sliceHeight: Int, border: Int = 1, mipmaps: Boolean = false): Texture

Slice up the texture with the given size with an added border but returns the newly created Texture. This can be used to prevent atlas bleeding.

Link copied to clipboard
fun Texture.slice(sliceWidth: Int, sliceHeight: Int): Array<Array<TextureSlice>>
Link copied to clipboard
fun Texture.sliceWithBorder(context: Context, sliceWidth: Int, sliceHeight: Int, border: Int = 1, mipmaps: Boolean = false): List<TextureSlice>

Slice up the texture in a list of TextureSlice with the given size with an added border. This can be used to prevent atlas bleeding.

Link copied to clipboard