shell_minimal.html 2.2 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. /* FIXME: with our GLFW example this block seems to break resizing and io.DisplaySize gets stuck */
  10. .emscripten {
  11. position: absolute;
  12. top: 0px;
  13. left: 0px;
  14. margin: 0px;
  15. border: 0;
  16. width: 100%;
  17. height: 100%;
  18. overflow: hidden;
  19. display: block;
  20. image-rendering: optimizeSpeed;
  21. image-rendering: -moz-crisp-edges;
  22. image-rendering: -o-crisp-edges;
  23. image-rendering: -webkit-optimize-contrast;
  24. image-rendering: optimize-contrast;
  25. image-rendering: crisp-edges;
  26. image-rendering: pixelated;
  27. -ms-interpolation-mode: nearest-neighbor;
  28. }
  29. </style>
  30. </head>
  31. <body>
  32. <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
  33. <script type='text/javascript'>
  34. var Module = {
  35. preRun: [],
  36. postRun: [],
  37. print: (function() {
  38. return function(text) {
  39. text = Array.prototype.slice.call(arguments).join(' ');
  40. console.log(text);
  41. };
  42. })(),
  43. printErr: function(text) {
  44. text = Array.prototype.slice.call(arguments).join(' ');
  45. console.error(text);
  46. },
  47. canvas: (function() {
  48. var canvas = document.getElementById('canvas');
  49. //canvas.addEventListener("webglcontextlost", function(e) { alert('FIXME: WebGL context lost, please reload the page'); e.preventDefault(); }, false);
  50. return canvas;
  51. })(),
  52. setStatus: function(text) {
  53. console.log("status: " + text);
  54. },
  55. monitorRunDependencies: function(left) {
  56. // no run dependencies to log
  57. }
  58. };
  59. window.onerror = function() {
  60. console.log("onerror: " + event);
  61. };
  62. </script>
  63. {{{ SCRIPT }}}
  64. </body>
  65. </html>