web api instance method
WebGLRenderingContext: useProgram() method
Available in workers
The WebGLRenderingContext.useProgram() method of the WebGL API sets the specified
WebGLProgram as part of the current rendering state.
Syntax
useProgram(program)
Parameters
program- : A
WebGLProgramto use.
- : A
Return value
None (undefined).
Examples
const program = gl.createProgram();
// Attach pre-existing shaders
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
gl.useProgram(program);
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.