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

Side by Side Diff: samples/openglui/src/flashingbox.dart

Issue 24698003: Removed the openglui sample app. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
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 flashingbox;
9
10 import 'gl.dart';
11
12 WebGLRenderingContext gl = null;
13
14 num r;
15 num g;
16 num b;
17
18 void setup(canvas, int w, int h, int f) {
19 if (canvas == null) {
20 canvas = new CanvasElement(width: w, height: h);
21 }
22 gl = canvas.getContext("experimental-webgl");
23 r = 0;
24 g = 0;
25 b = 0;
26 resize(w, h);
27 window.requestAnimationFrame(update);
28 log("Done setup");
29 }
30
31 void resize(int width, int height) {
32 gl.viewport(0, 0, width, height);
33 }
34
35 void update(when) {
36 gl.clearColor(r, g, b, 1.0);
37 gl.clear(WebGLRenderingContext.COLOR_BUFFER_BIT |
38 WebGLRenderingContext.DEPTH_BUFFER_BIT);
39 r = r + 0.1;
40 if (r > 1) {
41 r = 0;
42 g = g + 0.1;
43 }
44 if (g > 1) {
45 g = 0;
46 b = b + 0.1;
47 }
48 if (b > 1) {
49 b = 0;
50 }
51 glSwapBuffers();
52 window.requestAnimationFrame(update);
53 }
54
OLDNEW
« dart.gyp ('K') | « samples/openglui/src/chrome.hex ('k') | samples/openglui/src/gl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698