alistair
9 months ago
5 changed files with 857 additions and 751 deletions
@ -1,6 +1,16 @@
@@ -1,6 +1,16 @@
|
||||
|
||||
|
||||
all: |
||||
g++ -fsanitize=address -c particles.cpp -lSDL2 -g -o particles.o
|
||||
g++ -fsanitize=address -c game.cpp -lSDL2 -g -o game.o
|
||||
g++ -fsanitize=address -lSDL2 -g particles.o game.o -o main
|
||||
test: |
||||
$(CXX) -fsanitize=address -c particles.cpp -lSDL2 -g -o particles.o
|
||||
$(CXX) -fsanitize=address -c game.cpp -lSDL2 -g -o game.o
|
||||
$(CXX) -fsanitize=address -lSDL2 -g particles.o game.o -o main
|
||||
|
||||
pub: |
||||
$(CXX) -O2 -c particles.cpp -lSDL2 -o particles.o
|
||||
$(CXX) -O2 -c game.cpp -lSDL2 -o game.o
|
||||
$(CXX) -O2 -lSDL2 particles.o game.o -o main
|
||||
|
||||
|
||||
web: |
||||
$(CXX) -O2 -lSDL2 -s USE_SDL=2 particles.cpp game.cpp -o index.html --shell-file shell_minimal.html -s ALLOW_MEMORY_GROWTH=1
|
||||
|
||||
|
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
<!doctype html> |
||||
<html lang="en-us"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/> |
||||
<title>@HELLO_IMGUI_ICON_DISPLAY_NAME@</title> |
||||
<style> |
||||
body { margin: 0; background-color: black } |
||||
.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; |
||||
} |
||||
</style> |
||||
</head> |
||||
<body> |
||||
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> |
||||
<script type='text/javascript'> |
||||
var Module = { |
||||
preRun: [], |
||||
postRun: [], |
||||
print: (function() { |
||||
return function(text) { |
||||
text = Array.prototype.slice.call(arguments).join(' '); |
||||
console.log(text); |
||||
}; |
||||
})(), |
||||
printErr: function(text) { |
||||
text = Array.prototype.slice.call(arguments).join(' '); |
||||
console.error(text); |
||||
}, |
||||
canvas: (function() { |
||||
var canvas = document.getElementById('canvas'); |
||||
//canvas.addEventListener("webglcontextlost", function(e) { alert('FIXME: WebGL context lost, please reload the page'); e.preventDefault(); }, false); |
||||
return canvas; |
||||
})(), |
||||
setStatus: function(text) { |
||||
console.log("status: " + text); |
||||
}, |
||||
monitorRunDependencies: function(left) { |
||||
// no run dependencies to log |
||||
} |
||||
}; |
||||
window.onerror = function() { |
||||
console.log("onerror: " + event); |
||||
}; |
||||
</script> |
||||
{{{ SCRIPT }}} |
||||
</body> |
||||
</html> |
||||
|
Loading…
Reference in new issue