Texture

open class Texture(val width: Int, val height: Int, format: Int, type: Int, isRT: Boolean = false, internalFormat: Int = format, val target: Int = GL_TEXTURE_2D) : RenderResource

Parameters

format

pixel format passed to glTexImage2D (e.g. GL_RGBA, GL_DEPTH_COMPONENT).

type

pixel type passed to glTexImage2D (e.g. GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT).

internalFormat

internalformat passed to glTexImage2D. Defaults to format (unsized), which is the only legal value on WebGL1 / GLES2. Pass a sized internal format (e.g. GL_RGBA8, GL_DEPTH_COMPONENT16) only when Kgl.supportsSizedTextureFormats is true. Required for MSAA blit-resolve compatibility — the resolve target's internal format must literally match the multisample renderbuffer's (GL_RGBA8).

target

texture target. Defaults to GL_TEXTURE_2D. Pass GL_TEXTURE_CUBE_MAP for cube-map storage; the constructor will allocate all six face images.

Inheritors

BitmapTexture
ImageTexture
AVPlayerVideoTexture
CallbackVideoTexture
HtmlVideoTexture

Constructors

Link copied to clipboard
constructor(width: Int, height: Int, format: Int, type: Int, isRT: Boolean = false, internalFormat: Int = format, target: Int = GL_TEXTURE_2D)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Caller opt-out for mipmap generation.

Link copied to clipboard
val height: Int
Link copied to clipboard
val target: Int
Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
Link copied to clipboard
fun getTexParameter(name: Int): Int
Link copied to clipboard
Link copied to clipboard
open override fun release(dc: DrawContext)

Frees any resources associated with this instance. After this method returns the rendering resource is invalid, and any associated GL object is deleted.

Link copied to clipboard
fun setTexParameter(name: Int, param: Int)