GlProgram

open class GlProgram : GlBindable

Base class for a program that accepts a vertex and a fragment shader in the constructor. The program will be created automatically and released when release is called.

Subclasses are required to do two things - typically, during the onPreDraw callback: 1 Inspect the GlDrawable properties:

The vertex shader should then use the two to compute the gl_Position.

Constructors

GlProgram
Link copied to clipboard
common
fun GlProgram(handle: Int)
GlProgram
Link copied to clipboard
common
fun GlProgram(vertexShader: String, fragmentShader: String)
GlProgram
Link copied to clipboard
common
fun GlProgram(vararg shaders: GlShader)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

bind
Link copied to clipboard
common
open override fun bind()
draw
Link copied to clipboard
common
fun draw(drawable: GlDrawable, modelViewProjectionMatrix: FloatArray = drawable.modelMatrix)
onDraw
Link copied to clipboard
common
open fun onDraw(drawable: GlDrawable)
onPostDraw
Link copied to clipboard
common
open fun onPostDraw(drawable: GlDrawable)
onPreDraw
Link copied to clipboard
common
open fun onPreDraw(drawable: GlDrawable, modelViewProjectionMatrix: FloatArray)
release
Link copied to clipboard
common
open fun release()
unbind
Link copied to clipboard
common
open override fun unbind()

Properties

handle
Link copied to clipboard
common
val handle: Int

Inheritors

GlNativeFlatProgram
Link copied to clipboard
GlTextureProgram
Link copied to clipboard