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

Side by Side Diff: samples/simplegl/web/simplegl.dart

Issue 11362256: Added raytracer to gl samples. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 years, 1 month 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 | « samples/simplegl/web/raytrace_driver.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 /**
6 * A sample GL application.
7 */
8 library simplegl;
9
10 import 'gl.dart';
11
12 num r;
13 num g;
14 num b;
15
16 /**
17 * Invoked on initial startup.
18 */
19 void setup(GlContext gl) {
20 r = 0;
21 g = 0;
22 b = 0;
23 }
24
25 /**
26 * Invoked on each frame render.
27 */
28 void draw(GlContext gl) {
29 gl.clearColor(r, g, b, 1.0);
30 gl.clear(gl.COLOR_BUFFER_BIT |
31 gl.DEPTH_BUFFER_BIT);
32 r = r + 0.1;
33 if (r > 1) {
34 r = 0;
35 g = g + 0.1;
36 }
37 if (g > 1) {
38 g = 0;
39 b = b + 0.1;
40 }
41 if (b > 1) {
42 b = 0;
43 }
44 }
OLDNEW
« no previous file with comments | « samples/simplegl/web/raytrace_driver.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698