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

Unified Diff: samples/simplegl/web/flashingbox.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/simplegl/simplegl.html ('k') | samples/simplegl/web/flashingbox_driver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/simplegl/web/flashingbox.dart
diff --git a/samples/simplegl/web/simplegl.dart b/samples/simplegl/web/flashingbox.dart
similarity index 71%
rename from samples/simplegl/web/simplegl.dart
rename to samples/simplegl/web/flashingbox.dart
index 5e3c09f974cd891c61926b302259cc16c1b02238..40f7c3d8c3c28fb7dd4503157240c0d8fbbdc774 100644
--- a/samples/simplegl/web/simplegl.dart
+++ b/samples/simplegl/web/flashingbox.dart
@@ -5,7 +5,7 @@
/**
* A sample GL application.
*/
-library simplegl;
+library flashingbox;
import 'gl.dart';
@@ -16,19 +16,23 @@ num b;
/**
* Invoked on initial startup.
*/
-void setup(GlContext gl) {
+void setup() {
r = 0;
g = 0;
b = 0;
}
+void resize(int width, int height) {
+ gl.viewport(0, 0, width, height);
+}
+
/**
* Invoked on each frame render.
*/
-void draw(GlContext gl) {
+void draw() {
gl.clearColor(r, g, b, 1.0);
- gl.clear(gl.COLOR_BUFFER_BIT |
- gl.DEPTH_BUFFER_BIT);
+ gl.clear(WebGLRenderingContext.COLOR_BUFFER_BIT |
+ WebGLRenderingContext.DEPTH_BUFFER_BIT);
r = r + 0.1;
if (r > 1) {
r = 0;
« no previous file with comments | « samples/simplegl/simplegl.html ('k') | samples/simplegl/web/flashingbox_driver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698