From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../webglrenderingcontext/createtexture/index.html | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 files/fr/web/api/webglrenderingcontext/createtexture/index.html (limited to 'files/fr/web/api/webglrenderingcontext/createtexture') diff --git a/files/fr/web/api/webglrenderingcontext/createtexture/index.html b/files/fr/web/api/webglrenderingcontext/createtexture/index.html new file mode 100644 index 0000000000..a2ea8939ab --- /dev/null +++ b/files/fr/web/api/webglrenderingcontext/createtexture/index.html @@ -0,0 +1,78 @@ +--- +title: WebGLRenderingContext.createTexture() +slug: Web/API/WebGLRenderingContext/createTexture +tags: + - API + - Méthode + - Reference + - Textures + - WebGL + - WebGLRenderingContext +translation_of: Web/API/WebGLRenderingContext/createTexture +--- +
{{APIRef("WebGL")}}
+ +

La méthode WebGLRenderingContext.createTexture() de l'API WebGL crée et initialise un objet {{domxref("WebGLTexture")}}.

+ +

Syntaxe

+ +
WebGLTexture gl.createTexture();
+
+ +

Paramètres

+ +

Aucun.

+ +

Valeur retournée

+ +

Un objet {{domxref("WebGLTexture")}} auquel des images peuvent être liées.

+ +

Exemples

+ +

Voir aussi le tutoriel WebGL sur l'Utilisation de textures en WebGL.

+ +

Création d'une texture

+ +
var canevas = document.getElementById('canevas');
+var gl = canevas.getContext('webgl');
+var texture = gl.createTexture();
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('WebGL', "#5.14.8", "createTexture")}}{{Spec2('WebGL')}} +

Définition initiale.

+
{{SpecName('OpenGL ES 2.0', "glGenTextures.xml", "glGenTextures")}}{{Spec2('OpenGL ES 2.0')}}Page man de l’API OpenGL (similaire).
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.WebGLRenderingContext.createTexture")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf