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.
<init> |
GlProgram(handle: Int)GlProgram(vertexShader: String, fragmentShader: String)GlProgram(vararg shaders: GlShader)
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. GlProgram(handle: Int, ownsHandle: Boolean, vararg shaders: GlShader) |
handle |
val handle: Int |
bind |
open fun bind(): Unit |
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 |
onPostDraw |
open fun onPostDraw(drawable: GlDrawable): Unit |
onPreDraw |
open fun onPreDraw(drawable: GlDrawable, modelViewProjectionMatrix: FloatArray): Unit |
release |
open fun release(): Unit |
unbind |
open fun unbind(): Unit |
create |
fun fun create(vararg shaders: GlShader): Int |
use |
fun GlBindable.use(block: () -> Unit): Unit |
GlNativeFlatProgram |
An GlProgram that uses basic flat-shading rendering, based on FlatShadedProgram from grafika. open class GlNativeFlatProgram : GlProgram |
GlTextureProgram |
Base implementation for a GlProgram that draws textures. open class GlTextureProgram : GlProgram |