shell_minimal.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!doctype html>
  2. <html lang="en-us">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
  6. <title>Dear ImGui Emscripten example</title>
  7. <style>
  8. body { margin: 0; background-color: black }
  9. .emscripten {
  10. position: absolute;
  11. top: 0px;
  12. left: 0px;
  13. margin: 0px;
  14. border: 0;
  15. width: 100%;
  16. height: 100%;
  17. overflow: hidden;
  18. display: block;
  19. image-rendering: optimizeSpeed;
  20. image-rendering: -moz-crisp-edges;
  21. image-rendering: -o-crisp-edges;
  22. image-rendering: -webkit-optimize-contrast;
  23. image-rendering: optimize-contrast;
  24. image-rendering: crisp-edges;
  25. image-rendering: pixelated;
  26. -ms-interpolation-mode: nearest-neighbor;
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
  32. <script type='text/javascript'>
  33. var Module = {
  34. preRun: [],
  35. postRun: [],
  36. print: (function() {
  37. return function(text) {
  38. text = Array.prototype.slice.call(arguments).join(' ');
  39. console.log(text);
  40. };
  41. })(),
  42. printErr: function(text) {
  43. text = Array.prototype.slice.call(arguments).join(' ');
  44. console.error(text);
  45. },
  46. canvas: (function() {
  47. var canvas = document.getElementById('canvas');
  48. //canvas.addEventListener("webglcontextlost", function(e) { alert('FIXME: WebGL context lost, please reload the page'); e.preventDefault(); }, false);
  49. return canvas;
  50. })(),
  51. setStatus: function(text) {
  52. console.log("status: " + text);
  53. },
  54. monitorRunDependencies: function(left) {
  55. // no run dependencies to log
  56. }
  57. };
  58. window.onerror = function() {
  59. console.log("onerror: " + event);
  60. };
  61. </script>
  62. {{{ SCRIPT }}}
  63. </body>
  64. </html>