library / com.otaliastudios.opengl.program / GlTextureProgram

GlTextureProgram

open class GlTextureProgram : GlProgram

Base implementation for a GlProgram that draws textures.

Constructors

<init>

GlTextureProgram(vertexShader: String = SIMPLE_VERTEX_SHADER, fragmentShader: String = SIMPLE_FRAGMENT_SHADER, vertexPositionName: String = "aPosition", vertexMvpMatrixName: String = "uMVPMatrix", textureCoordsName: String? = "aTextureCoord", textureTransformName: String? = "uTexMatrix")
GlTextureProgram(handle: Int, vertexPositionName: String = "aPosition", vertexMvpMatrixName: String = "uMVPMatrix", textureCoordsName: String? = "aTextureCoord", textureTransformName: String? = "uTexMatrix")GlTextureProgram(handle: Int, ownsHandle: Boolean, vertexPositionName: String, vertexMvpMatrixName: String, textureCoordsName: String?, textureTransformName: String?)

Base implementation for a GlProgram that draws textures.

Properties

texture

var texture: GlTexture?

If not null, GlTextureProgram will care about the texture lifecycle: binding, unbinding and destroying.

textureTransform

var textureTransform: FloatArray

Inherited Properties

handle

val handle: Int

Functions

computeTextureCoordinate

open fun computeTextureCoordinate(vertex: Int, drawable: Gl2dDrawable, value: Float, min: Float, max: Float, horizontal: Boolean): Float

onPostDraw

open fun onPostDraw(drawable: GlDrawable): Unit

onPreDraw

open fun onPreDraw(drawable: GlDrawable, modelViewProjectionMatrix: FloatArray): Unit

release

open fun release(): Unit

Inherited Functions

draw

fun draw(drawable: GlDrawable, modelViewProjectionMatrix: FloatArray = drawable.modelMatrix): Unit

getAttribHandle

fun getAttribHandle(name: String): GlProgramLocation

getUniformHandle

fun getUniformHandle(name: String): GlProgramLocation

onDraw

open fun onDraw(drawable: GlDrawable): Unit

Companion Object Properties

SIMPLE_FRAGMENT_SHADER

const val SIMPLE_FRAGMENT_SHADER: String

SIMPLE_VERTEX_SHADER

const val SIMPLE_VERTEX_SHADER: String