| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
| 2 "http://www.w3.org/TR/html4/loose.dtd"> | |
| 3 <html> | |
| 4 <head> | |
| 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> | |
| 9 </head> | |
| 10 <body> | |
| 11 <div id="description"></div> | |
| 12 <div id="console"></div> | |
| 13 <canvas id="canvas" width="2" height="2"> </canvas> | |
| 14 <script> | |
| 15 description("This test ensures WebGL implementations vertexAttrib can be set and
read."); | |
| 16 | |
| 17 debug(""); | |
| 18 debug("Canvas.getContext"); | |
| 19 | |
| 20 var gl = create3DContext(document.getElementById("canvas")); | |
| 21 if (!gl) { | |
| 22 testFailed("context does not exist"); | |
| 23 } else { | |
| 24 testPassed("context exists"); | |
| 25 | |
| 26 debug(""); | |
| 27 debug("Checking gl.vertexAttrib."); | |
| 28 | |
| 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'); | |
| 34 | |
| 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'); | |
| 40 } | |
| 41 | |
| 42 debug(""); | |
| 43 | |
| 44 </script> | |
| 45 | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |