WebGLRenderingContext.useProgram()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

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

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
useProgram

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Voir aussi