◐ Shell
clean mode source ↗

WebGLRenderingContext: useProgram() method - Web APIs | MDN

Syntax

js

useProgram(program)

Parameters

program

A WebGLProgram to use.

Return value

None (undefined).

Examples

js

const program = gl.createProgram();

// Attach pre-existing shaders
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);

gl.linkProgram(program);
gl.useProgram(program);

Specifications

Specification
WebGL Specification
# 5.14.9

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.