aboutsummaryrefslogtreecommitdiff
path: root/src/shell.html
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-12 11:24:16 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-12 11:24:16 -0800
commita5bd3ed73db5f3d499eab532034bb9f6960df28f (patch)
treeaab395631955f7359389f344b75432a784886799 /src/shell.html
parentae02feec361db8a69d51a69d51b02ea742212a94 (diff)
support for generating html in emcc, and a test for that that also tests SDL, and some fixes for SDL
Diffstat (limited to 'src/shell.html')
-rw-r--r--src/shell.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/shell.html b/src/shell.html
new file mode 100644
index 00000000..284bc8d6
--- /dev/null
+++ b/src/shell.html
@@ -0,0 +1,32 @@
+<html>
+ <head>
+ <title>Emscripten-Generated Code</title>
+ <body>
+ <center>
+ <canvas id='canvas' width='256' height='256'></canvas>
+ </center>
+ <hr>
+ <div id='output'></div>
+ <hr>
+ <script type='text/javascript'>
+ // implement print
+ var print = (function() {
+ var element = document.getElementById('output');
+ return function(text) {
+ element.innerHTML += text.replace('\n', '<br>', 'g') + '<br>';
+ };
+ })();
+
+ // connect to canvas
+ var Module = {
+ canvas: document.getElementById('canvas'),
+ ctx2D: document.getElementById('canvas').getContext('2d')
+ };
+ if (!Module.ctx2D) alert('Canvas not available :(');
+
+ // The compiled code
+ {{{ SCRIPT_CODE }}}
+ </script>
+ </body>
+</html>
+