[7DRL Prep] WASM fullscreen on mobile devices #246

Closed
opened 2026-02-09 02:44:02 +00:00 by john · 3 comments
Owner

Goal

Make the Emscripten/WebAssembly build go fullscreen on mobile devices.

Current Problems

  • Canvas hardcoded to 1024x768 in src/shell.html JS (lines 640-641)
  • No Fullscreen API (requestFullscreen()) anywhere
  • Body has 20px padding on all sides - wastes mobile screen space
  • REPL panel always visible - takes half the screen on mobile
  • No safe area handling for notched phones
  • Missing viewport meta: viewport-fit=cover, user-scalable=no

Implementation

  1. Update viewport meta tags for mobile
  2. Add mobile CSS breakpoints (hide REPL, zero padding, fullscreen canvas)
  3. Dynamic canvas resizing via JS resize listener
  4. Fullscreen API integration
  5. Optional: game-only mode (no REPL) via URL param or build flag

Key Files

  • src/shell.html - Main HTML template
  • src/emscripten_pre.js - Browser quirk fixes
  • CMakeLists.txt:265-321 - Emscripten config

Detailed Report

.claude/reports/wasm_mobile_fullscreen.md

7DRL Critical Path

20 days until 7DRL (Feb 28). Must be working for itch.io deployment.

## Goal Make the Emscripten/WebAssembly build go fullscreen on mobile devices. ## Current Problems - Canvas hardcoded to 1024x768 in `src/shell.html` JS (lines 640-641) - No Fullscreen API (`requestFullscreen()`) anywhere - Body has 20px padding on all sides - wastes mobile screen space - REPL panel always visible - takes half the screen on mobile - No safe area handling for notched phones - Missing viewport meta: `viewport-fit=cover`, `user-scalable=no` ## Implementation 1. Update viewport meta tags for mobile 2. Add mobile CSS breakpoints (hide REPL, zero padding, fullscreen canvas) 3. Dynamic canvas resizing via JS resize listener 4. Fullscreen API integration 5. Optional: game-only mode (no REPL) via URL param or build flag ## Key Files - `src/shell.html` - Main HTML template - `src/emscripten_pre.js` - Browser quirk fixes - `CMakeLists.txt:265-321` - Emscripten config ## Detailed Report `.claude/reports/wasm_mobile_fullscreen.md` ## 7DRL Critical Path 20 days until 7DRL (Feb 28). Must be working for itch.io deployment.
Author
Owner

Intended labels (apply manually due to MCP label bug): priority:tier1-active, Minor Feature, system:rendering

**Intended labels** (apply manually due to MCP label bug): `priority:tier1-active`, `Minor Feature`, `system:rendering`
Author
Owner

Largely addressed by commit 726a9cf ("Mobile-ish emscripten support"):

  • New src/shell_game.html — canvas-only template (no REPL)
  • wasm-game build target uses this shell
  • Viewport modes (fit/center/stretch) now work consistently across SFML and SDL2
  • Portrait aspect ratio + fullscreen sufficient for mobile through 7DRL

Remaining work (if any) is polish — safe area insets, orientation lock. Not blocking 7DRL.

Largely addressed by commit 726a9cf ("Mobile-ish emscripten support"): - New `src/shell_game.html` — canvas-only template (no REPL) - `wasm-game` build target uses this shell - Viewport modes (fit/center/stretch) now work consistently across SFML and SDL2 - Portrait aspect ratio + fullscreen sufficient for mobile through 7DRL Remaining work (if any) is polish — safe area insets, orientation lock. Not blocking 7DRL.
Author
Owner

Closing as sufficient. The wasm-game build target deploys to itch.io with fullscreen support and works on mobile. Remaining items (safe area handling for notched phones, pixel-perfect mobile UX) are polish beyond what's needed for 7DRL. Can reopen if a specific mobile issue surfaces during the jam.

Closing as sufficient. The `wasm-game` build target deploys to itch.io with fullscreen support and works on mobile. Remaining items (safe area handling for notched phones, pixel-perfect mobile UX) are polish beyond what's needed for 7DRL. Can reopen if a specific mobile issue surfaces during the jam.
john closed this issue 2026-02-15 00:31:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
john/McRogueFace#246
No description provided.