| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A solar system visualization. | 6 * A solar system visualization. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 library solar3d; | 9 library solar3d; |
| 10 | 10 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 document.on.keyDown.add(keydown); | 214 document.on.keyDown.add(keydown); |
| 215 document.on.keyUp.add(keyup); | 215 document.on.keyUp.add(keyup); |
| 216 document.on.mouseMove.add(mouseMove); | 216 document.on.mouseMove.add(mouseMove); |
| 217 window.on.mouseWheel.add(mouseWheel); | 217 window.on.mouseWheel.add(mouseWheel); |
| 218 document.on.fullscreenChange.add(fullscreenChange); | 218 document.on.fullscreenChange.add(fullscreenChange); |
| 219 } | 219 } |
| 220 | 220 |
| 221 num renderTime; | 221 num renderTime; |
| 222 | 222 |
| 223 void update(double time) { | 223 void update(double time) { |
| 224 num t = new Date.now().millisecondsSinceEpoch; | 224 num t = new DateTime.now().millisecondsSinceEpoch; |
| 225 | 225 |
| 226 if (renderTime != null) { | 226 if (renderTime != null) { |
| 227 showFps((1000 / (t - renderTime)).round()); | 227 showFps((1000 / (t - renderTime)).round()); |
| 228 } | 228 } |
| 229 | 229 |
| 230 renderTime = t; | 230 renderTime = t; |
| 231 | 231 |
| 232 glContext.viewport(0, 0, width, height); | 232 glContext.viewport(0, 0, width, height); |
| 233 glContext.clearColor(0.0, 0.0, 0.0, 1.0); | 233 glContext.clearColor(0.0, 0.0, 0.0, 1.0); |
| 234 glContext.clearDepth(1.0); | 234 glContext.clearDepth(1.0); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 print(log); | 536 print(log); |
| 537 } | 537 } |
| 538 } | 538 } |
| 539 | 539 |
| 540 /** | 540 /** |
| 541 * The entry point to the application. | 541 * The entry point to the application. |
| 542 */ | 542 */ |
| 543 void main() { | 543 void main() { |
| 544 application.startup('#container'); | 544 application.startup('#container'); |
| 545 } | 545 } |
| OLD | NEW |