WebGLProgram class
The is part of the WebGL API and is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL).
WebGLObject
WebGLProgram
To create a , call the GL context's createProgram()
function.
After attaching the shader programs using attachShader()
, you
link them into a usable program. This is shown in the code below.
[var program = gl.createProgram();
// Attach pre-existing shaders gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
if ( !gl.getProgramParameter( program, gl.LINK_STATUS) ) {
var info = gl.getProgramInfoLog(program);
throw 'Could not compile WebGL program. \n\n' + info;
}
]
See WebGLShader for information on creating the vertexShader
and fragmentShader
in the above example.
- Implemented types
- Annotations
-
- @JS()
- @staticInterop
Constructors
- WebGLProgram()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited