diff --git a/demos/html5/MAKE.bat b/demos/html5/MAKE.bat
index 003ec84..e397df1 100644
--- a/demos/html5/MAKE.bat
+++ b/demos/html5/MAKE.bat
@@ -1,4 +1,4 @@
-if "%1"=="" MAKE.bat demo_ddraw.c
+if "%1"=="" MAKE.bat demo_collide.c
del index.html 2>NUL >NUL
del index.worker.js 2>NUL >NUL
@@ -19,5 +19,5 @@ rem cook art
rem host webserver, compile and launch
rem start python -m http.server --bind 127.0.0.1 8000
-call emcc %* -g ..\..\engine\v4k.c -I..\..\engine -o index.html -pthread -s FULL_ES3 -s USE_PTHREADS -s USE_GLFW=3 -s SINGLE_FILE=1 -s PRECISE_F32=1 -s TOTAL_MEMORY=256mb -s ALLOW_MEMORY_GROWTH=1 -s ENVIRONMENT=worker,web --shell-file template.html -Wfatal-errors --preload-file .art[00].zip@index.zip -lidbfs.js
+call emcc %* -g ..\..\engine\v4k.c -I..\..\engine -o index.html -pthread -s FULL_ES3 -s USE_PTHREADS -s USE_GLFW=3 -s SINGLE_FILE=1 -s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 -s PRECISE_F32=1 -s TOTAL_MEMORY=256mb -s ALLOW_MEMORY_GROWTH=1 -s ENVIRONMENT=worker,web --shell-file template.html -Wfatal-errors --preload-file .art[00].zip@index.zip -lidbfs.js
rem emrun index.html
diff --git a/demos/html5/demo_collide.c b/demos/html5/demo_collide.c
index c97b46d..8ac651b 100644
--- a/demos/html5/demo_collide.c
+++ b/demos/html5/demo_collide.c
@@ -5,7 +5,6 @@
#include "v4k.h"
-// -- demo
int paused;
camera_t cam;
@@ -58,7 +57,7 @@ void game_loop(void *userdata) {
view = add2(view, vec2(touch_view.x, -touch_view.y));
// apply inputs
- camera_move(&cam, move.x,move.y,move.z);
+ camera_moveby(&cam, move);
camera_fps(&cam, view.x,view.y);
}
diff --git a/demos/html5/template.html b/demos/html5/template.html
index 2202476..fb83976 100644
--- a/demos/html5/template.html
+++ b/demos/html5/template.html
@@ -100,13 +100,15 @@
},
canvas: (function() {
var canvas = document.getElementById('canvas');
- canvas.width = window.innerWidth;
- canvas.height = window.innerHeight;
+ var dpi = window.devicePixelRatio;
+ canvas.width = window.innerWidth*dpi;
+ canvas.height = window.innerHeight*dpi;
window.addEventListener('resize', () => {
- if (canvas.canResize && !window.isFullscreen) {
- canvas.width = window.innerWidth;
- canvas.height = window.innerHeight;
+ if (canvas.canResize) {
+ dpi = window.devicePixelRatio;
+ canvas.width = window.innerWidth*dpi;
+ canvas.height = window.innerHeight*dpi;
}
})
return canvas;
@@ -135,27 +137,15 @@