Wrapper for a WebGL program, containing all the information that was used to create it.
A WebGLProgram should never be exposed outside the WebGLRenderer, so the WebGLRenderer can handle context loss and other events without other systems having to be aware of it. Always use WebGLProgramWrapper instead.
new WebGLProgramWrapper(gl, vertexSource, fragmentShader)
name | type | description |
---|---|---|
gl | WebGLRenderingContext |
The WebGLRenderingContext to create the WebGLProgram for. |
vertexSource | string |
The vertex shader source code as a string. |
fragmentShader | string |
The fragment shader source code as a string. |
The fragment shader source code as a string.
The WebGLRenderingContext that owns this WebGLProgram.
The vertex shader source code as a string.
The WebGLProgram being wrapped by this class.
This property could change at any time. Therefore, you should never store a reference to this value. It should only be passed directly to the WebGL API for drawing.
Creates a WebGLProgram from the given vertex and fragment shaders.
This is called automatically by the constructor. It may also be called again if the WebGLProgram needs re-creating.
Remove this WebGLProgram from the GL context.