WebGLRenderingContext.useProgram()

La méthode WebGLRenderingContext.useProgram() de l'API WebGL définit le WebGLProgram spécifié comme faisant partie de l'état de rendu en cours.

Syntaxe

js
void gl.useProgram(programme);

Paramètres

programme

Un WebGLProgram à utiliser.

Valeur retournée

Aucune.

Exemples

js
var programme = gl.createProgram();

// Attacher les shaders pré-existants
gl.attachShader(programme, vertexShader);
gl.attachShader(programme, fragmentShader);

gl.linkProgram(programme);
gl.useProgram(programme);

Spécifications

Specification
WebGL Specification
# 5.14.9

Compatibilité des navigateurs

BCD tables only load in the browser

Voir aussi