OLD | NEW |
| (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 * An HTML-based prototype implementation for GL. | |
7 */ | |
8 | |
9 // TODO(vsm): Move this out of the common directory. | |
10 library gl_html; | |
11 | |
12 import 'dart:html' as html; | |
13 export 'dart:html' show WebGLRenderingContext; | |
14 export 'dart:html' show Float32Array; | |
15 export 'dart:html' show ImageElement; | |
16 export 'dart:html' show CanvasElement; | |
17 export 'dart:html' show AudioElement; | |
18 export 'dart:html' show KeyboardEvent; | |
19 export 'dart:html' show MouseEvent; | |
20 export 'dart:html' show HtmlDocument; | |
21 export 'dart:html' show CanvasRenderingContext2D; | |
22 export 'dart:html' show Rect; | |
23 | |
24 get document => html.document; | |
25 get window => html.window; | |
26 get sfx_extension => 'mp3'; | |
27 | |
28 log(message) => window.console.log(message); | |
29 glSwapBuffers() {} | |
30 | |
31 getDisplayCanvas(resize) { | |
32 var canvas = document.query('#canvas'); | |
33 if (canvas == null) { | |
34 canvas = new html.CanvasElement( | |
35 width: window.innerWidth, height: window.innerHeight); | |
36 document.body.nodes.add(canvas); | |
37 } | |
38 return canvas; | |
39 } | |
40 | |
41 | |
OLD | NEW |