]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
Add jackw11111's minimal shell file for emscripten (Thanks StackOverflow)
authorLock l00p <hakzstudios@gmail.com>
Sat, 30 Sep 2023 02:24:36 +0000 (02:24 +0000)
committerLock l00p <hakzstudios@gmail.com>
Sat, 30 Sep 2023 02:24:36 +0000 (02:24 +0000)
misc/buildfiles/emscripten/shell.html [new file with mode: 0644]
misc/tools/all/xonotic.subr

diff --git a/misc/buildfiles/emscripten/shell.html b/misc/buildfiles/emscripten/shell.html
new file mode 100644 (file)
index 0000000..4b3b1d2
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+
+<body>
+
+    <!-- Create the canvas that the C++ code will draw into -->
+    <canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
+
+    <!-- Allow the C++ to access the canvas element --> 
+    <script type='text/javascript'>
+        var Module = {
+            canvas: (function() { return document.getElementById('canvas'); })()
+        };
+    </script>
+    
+    <!-- Where the script shall be -->
+    {{{ SCRIPT }}}
+    
+</body>
+
+</html>
\ No newline at end of file
index 6e20f7ec61ef6c800071c243b84f4befbddd58e6..108decc47805e3d9cf688d9d0fe8c9e94938264e 100755 (executable)
@@ -310,7 +310,7 @@ case "$cmd" in
                        verbose emmake make $MAKEFLAGS clean
                fi
                for T in $TARGETS; do
-                       verbose emmake make $MAKEFLAGS LDFLAGS_EXTRA='--pre-js ../../../../misc/buildfiles/emscripten/prejs.js -sSINGLE_FILE -sFULL_ES2 -sUSE_ZLIB -sINITIAL_MEMORY=100MB' EXE_UNIXSDL="darkplaces-emscripten.html" DP_SSE=0 CFLAGS_EXTRA="-I../../../../misc/builddeps/emscripten/d0_blind_id/include -L../../../../misc/builddeps/emscripten/d0_blind_id/lib -Wl,-rpath,../../../../misc/builddeps/emscripten/d0_blind_id/lib -I../../../../misc/builddeps/emscripten/gmp/include -L../../../../misc/builddeps/emscripten/gmp/lib -Wl,-rpath,../../../../misc/builddeps/emscripten/gmp/lib -L../../../../misc/builddeps/emscripten/jpeg/lib/ -Wl,-rpath,../../../../misc/builddeps/emscripten/jpeg/lib/ -I../../../../misc/builddeps/emscripten/jpeg/include/ -sUSE_SDL=2 -sUSE_ZLIB=1 -DUSE_GLES2 " LIBM="" LIBZ="" LIBJPEG="" STRIP=: "$@" "$T"
+                       verbose emmake make $MAKEFLAGS LDFLAGS_EXTRA='--pre-js ../../../../misc/buildfiles/emscripten/prejs.js --shell-file ../../../../misc/buildfiles/emscripten/shell.html  -sSINGLE_FILE -sFULL_ES2 -sUSE_ZLIB -sINITIAL_MEMORY=100MB' EXE_UNIXSDL="darkplaces-emscripten.html" DP_SSE=0 CFLAGS_EXTRA="-I../../../../misc/builddeps/emscripten/d0_blind_id/include -L../../../../misc/builddeps/emscripten/d0_blind_id/lib -Wl,-rpath,../../../../misc/builddeps/emscripten/d0_blind_id/lib -I../../../../misc/builddeps/emscripten/gmp/include -L../../../../misc/builddeps/emscripten/gmp/lib -Wl,-rpath,../../../../misc/builddeps/emscripten/gmp/lib -L../../../../misc/builddeps/emscripten/jpeg/lib/ -Wl,-rpath,../../../../misc/builddeps/emscripten/jpeg/lib/ -I../../../../misc/builddeps/emscripten/jpeg/include/ -sUSE_SDL=2 -sUSE_ZLIB=1 -DUSE_GLES2 " LIBM="" LIBZ="" LIBJPEG="" STRIP=: "$@" "$T"
                done
                for T in $BAD_TARGETS; do
                        $ECHO "Warning: discarded invalid client $T."