Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: conformance/attribs/gl-enable-vertex-attrib.html

Issue 8342021: Add webgl conformance tests r15841. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « conformance/attribs/00_test_list.txt ('k') | conformance/attribs/gl-vertex-attrib.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 <!--
2 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 -->
6 <!DOCTYPE html>
7 <html>
8 <head>
9 <meta charset="utf-8">
10 <title>WebGL Enable Vertex Attrib Test</title>
11 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
12 <script src="../../resources/js-test-pre.js"></script>
13 <script src="../resources/webgl-test.js"> </script>
14 </head>
15 <body>
16 <canvas id="example" width="50" height="50">
17 </canvas>
18 <div id="description"></div>
19 <div id="console"></div>
20 <script id="vshader" type="x-shader/x-vertex">
21 attribute vec4 vPosition;
22 void main()
23 {
24 gl_Position = vPosition;
25 }
26 </script>
27
28 <script id="fshader" type="x-shader/x-fragment">
29 void main()
30 {
31 gl_FragColor = vec4(1.0,0.0,0.0,1.0);
32 }
33 </script>
34
35 <script>
36 gl = initWebGL("example", "vshader", "fshader", [ "vPosition"], [ 0, 0, 0, 1 ], 1);
37 gl.viewport(0, 0, 50, 50);
38
39 var vertexObject = gl.createBuffer();
40 gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
41 gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5 ,0 ]), gl.STATIC_DRAW);
42 gl.enableVertexAttribArray(0);
43 gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
44
45 gl.enableVertexAttribArray(3);
46 glErrorShouldBe(gl, gl.NO_ERROR);
47
48 gl.drawArrays(gl.TRIANGLES, 0, 3);
49 glErrorShouldBe(gl, gl.INVALID_OPERATION);
50
51 successfullyParsed = true;
52 </script>
53 <script src="../../resources/js-test-post.js"></script>
54
55 </body>
56 </html>
57
OLDNEW
« no previous file with comments | « conformance/attribs/00_test_list.txt ('k') | conformance/attribs/gl-vertex-attrib.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698