1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
6 <title>WebGL vertexAttrib Conformance Tests
</title>
7 <script src=
"../../../resources/js-test.js"></script>
8 <script src=
"resources/webgl-test.js"></script>
11 <div id=
"description"></div>
12 <div id=
"console"></div>
13 <canvas id=
"canvas" width=
"2" height=
"2"> </canvas>
15 description("This test ensures WebGL implementations vertexAttrib can be set and read.");
18 debug("Canvas.getContext");
20 var gl
= create3DContext(document
.getElementById("canvas"));
22 testFailed("context does not exist");
24 testPassed("context exists");
27 debug("Checking gl.vertexAttrib.");
29 gl
.vertexAttrib4fv(0, [1, 2, 3, 4]);
30 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[0]', '1');
31 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[1]', '2');
32 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[2]', '3');
33 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[3]', '4');
35 gl
.vertexAttrib1f(0, 5);
36 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[0]', '5');
37 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[1]', '0');
38 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[2]', '0');
39 shouldBe('gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB)[3]', '1');