2019-04-13 15:25:06 +00:00
|
|
|
<!doctype html>
|
|
|
|
<html lang="en-us">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
2019-04-15 18:55:52 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
|
2023-02-02 17:08:17 +00:00
|
|
|
<title>Dear ImGui Emscripten example</title>
|
2019-04-13 15:25:06 +00:00
|
|
|
<style>
|
2019-04-15 18:55:52 +00:00
|
|
|
body { margin: 0; background-color: black }
|
2023-02-02 17:08:17 +00:00
|
|
|
/* FIXME: with our GLFW example this block seems to break resizing and io.DisplaySize gets stuck */
|
2019-04-15 18:55:52 +00:00
|
|
|
.emscripten {
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
left: 0px;
|
|
|
|
margin: 0px;
|
|
|
|
border: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
display: block;
|
|
|
|
image-rendering: optimizeSpeed;
|
|
|
|
image-rendering: -moz-crisp-edges;
|
|
|
|
image-rendering: -o-crisp-edges;
|
|
|
|
image-rendering: -webkit-optimize-contrast;
|
|
|
|
image-rendering: optimize-contrast;
|
|
|
|
image-rendering: crisp-edges;
|
|
|
|
image-rendering: pixelated;
|
|
|
|
-ms-interpolation-mode: nearest-neighbor;
|
|
|
|
}
|
2019-04-13 15:25:06 +00:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2019-04-15 18:55:52 +00:00
|
|
|
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
|
2019-04-13 15:25:06 +00:00
|
|
|
<script type='text/javascript'>
|
|
|
|
var Module = {
|
|
|
|
preRun: [],
|
|
|
|
postRun: [],
|
|
|
|
print: (function() {
|
2019-04-15 18:55:52 +00:00
|
|
|
return function(text) {
|
|
|
|
text = Array.prototype.slice.call(arguments).join(' ');
|
|
|
|
console.log(text);
|
|
|
|
};
|
2019-04-13 15:25:06 +00:00
|
|
|
})(),
|
|
|
|
printErr: function(text) {
|
2019-04-15 18:55:52 +00:00
|
|
|
text = Array.prototype.slice.call(arguments).join(' ');
|
2019-04-13 15:25:06 +00:00
|
|
|
console.error(text);
|
|
|
|
},
|
|
|
|
canvas: (function() {
|
2019-04-15 18:55:52 +00:00
|
|
|
var canvas = document.getElementById('canvas');
|
|
|
|
//canvas.addEventListener("webglcontextlost", function(e) { alert('FIXME: WebGL context lost, please reload the page'); e.preventDefault(); }, false);
|
|
|
|
return canvas;
|
2019-04-13 15:25:06 +00:00
|
|
|
})(),
|
|
|
|
setStatus: function(text) {
|
2019-04-15 18:55:52 +00:00
|
|
|
console.log("status: " + text);
|
2019-04-13 15:25:06 +00:00
|
|
|
},
|
|
|
|
monitorRunDependencies: function(left) {
|
2019-04-15 18:55:52 +00:00
|
|
|
// no run dependencies to log
|
2019-04-13 15:25:06 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
window.onerror = function() {
|
2019-04-15 18:55:52 +00:00
|
|
|
console.log("onerror: " + event);
|
2019-04-13 15:25:06 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
{{{ SCRIPT }}}
|
|
|
|
</body>
|
|
|
|
</html>
|