]> git.seodisparate.com - jumpartifact.com_demo_0/commitdiff
Attempt to fix wrong canvas size
authorStephen Seo <seo.disparate@gmail.com>
Thu, 21 Mar 2024 07:56:49 +0000 (16:56 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 21 Mar 2024 07:56:49 +0000 (16:56 +0900)
After bumping emsdk version, the canvas loads with an invalid size. This
commit attempts to fix this.

src/main.cc

index e2ef5564d90ec94d8432110fe2d333f7530dce11..5dfb1e5b448c727a55892b9e8487954531a84508 100644 (file)
@@ -57,7 +57,11 @@ void jumpartifact_demo_update(void *ud) {
 }
 
 int main() {
+#ifdef __EMSCRIPTEN__
+  InitWindow(call_js_get_canvas_width(), call_js_get_canvas_height(), "Demo");
+#else
   InitWindow(800, 800, "Demo");
+#endif
 
 #ifdef NDEBUG
   SetTraceLogLevel(LOG_WARNING);