Skip to content

Commit

Permalink
Merge branch 'main' of git.sr.ht:~mrms/tophat
Browse files Browse the repository at this point in the history
  • Loading branch information
marekmaskarinec committed Jan 5, 2024
2 parents 8bcc63a + dd64ad9 commit 6d66dc0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/emscripten_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

# run make to do all the necessary embedding stuff
# make
make

cc () {
echo EMCC $f
Expand Down
5 changes: 2 additions & 3 deletions cmd/th_emscripten_link
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/sh

_=${TH_DIR:=../th_wasm_data}

TH_DIR=$(dirname $(readlink -f $0))/../
echo Data directory: $TH_DIR

mkdir -p $TH_DIR
Expand All @@ -28,7 +27,7 @@ echo Linking...
emcc -O3 --sASYNCIFY -Wall -fno-strict-aliasing -Wno-format-security\
$TH_DIR/th_emscripten.a \
-s ALLOW_MEMORY_GROWTH=1 \
-s ASYNCIFY_STACK_SIZE=2000000 \
-s STACK_SIZE=2MB \
-lc \
-lm \
-sMIN_WEBGL_VERSION=2 \
Expand Down
11 changes: 10 additions & 1 deletion etc/shell.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
})(),
canvas: (function() {
var canvas = document.getElementById('canvas');
window.focus();
canvas.focus();

canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);

Expand All @@ -58,12 +60,19 @@
};
window.addEventListener("resize", (e) => {
var canvas = document.getElementById('canvas')
window.focus();
canvas.focus();
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
})
window.addEventListener("click", (e) => {
var canvas = document.getElementById('canvas')
window.focus();
canvas.focus();
})
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

Module.setStatus('Downloading...');
window.onerror = function() {
Module.setStatus('Exception thrown, see JavaScript console');
Expand Down
2 changes: 1 addition & 1 deletion lib/sokol
Submodule sokol updated from 1e1e7d to 896daa
2 changes: 1 addition & 1 deletion lib/stb

0 comments on commit 6d66dc0

Please sign in to comment.