OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <meta charset="utf-8"> | |
4 <script src="../../../resources/js-test.js"></script> | |
5 <script src="resources/webgl-test.js"></script> | |
6 <script src="resources/webgl-test-utils.js"></script> | |
7 </head> | |
8 <body> | |
9 <canvas id="example" width="4px" height="4px"></canvas> | |
10 <div id="description"></div> | |
11 <div id="console"></div> | |
12 <script> | |
13 description('Verifies that GL texture bindings do not change when canvas is resi
zed'); | |
14 | |
15 var err; | |
16 var wtu = WebGLTestUtils; | |
17 var canvas = document.getElementById("example"); | |
18 var gl = wtu.create3DContext(canvas); | |
19 var program = wtu.setupTexturedQuad(gl); | |
20 | |
21 var green = [0, 255, 0, 255]; | |
22 var blue = [0, 0, 255, 255]; | |
23 var tex0 = gl.createTexture(); | |
24 wtu.fillTexture(gl, tex0, 1, 1, blue, 0); | |
25 gl.activeTexture(gl.TEXTURE1) | |
26 var tex1 = gl.createTexture(); | |
27 wtu.fillTexture(gl, tex1, 1, 1, green, 0); | |
28 | |
29 var loc = gl.getUniformLocation(program, "tex"); | |
30 | |
31 function test() { | |
32 gl.viewport(0, 0, canvas.width, canvas.height); | |
33 gl.uniform1i(loc, 0); | |
34 wtu.drawQuad(gl); | |
35 wtu.checkCanvas(gl, blue, "should be blue"); | |
36 gl.uniform1i(loc, 1); | |
37 wtu.drawQuad(gl); | |
38 wtu.checkCanvas(gl, green, "should be green"); | |
39 } | |
40 | |
41 debug("test before resizing canvas"); | |
42 test(); | |
43 debug("test after resizing canvas"); | |
44 canvas.width = 8; | |
45 test(); | |
46 | |
47 successfullyParsed = true; | |
48 </script> | |
49 </body> | |
50 </html> | |
51 | |
OLD | NEW |