-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
See JSEvents_resizeCanvasForFullscreen, where strategy is supplied.
Our resize options resizeCanvasOnFullscreenChange and adjustViewportByDevicePixelRatio are appropriate when using the default strategy (via emscripten_request_fullscreen()). However, this differs when specifying the strategy by emscripten_request_fullscreen_strategy() and emscripten_request_softfullscreen():
EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONEdoes not apply any canvas sizing behavior. This is default.EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_STDDEFis equivalent to{ resizeCanvasOnFullscreenChange: true, adjustViewportByDevicePixelRatio: false}EMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_HIDEFis equivalent to{ resizeCanvasOnFullscreenChange: true, adjustViewportByDevicePixelRatio: true}
Resolution
- Make
resizeCanvasOnFullscreenChangeandadjustViewportByDevicePixelRatiointo private variables - When triggering fullscreen from JS-side, set these both true
- Patch
JSEvents.resizeCanvasForFullscreento set these both variables to true ifEMSCRIPTEN_FULLSCREEN_CANVAS_SCALE_NONE, otherwise set both variables to false - Disable all the above behavior if
resizeCanvasOnElementSizingis false -
fixCanvasViewportis still necessary for non-fullscreen operations. In the canvas resize handler, attach this call toresizeCanvasOnElementSizinginstead ofadjustViewportByDevicePixelRatio. - Expose
EMSCRIPTEN_FULLSCREEN_FILTERING_NEAREST/BILINEAR(CSS is only changed from default forNEAREST--image-rendering: optimize-speed;
Notes
- How well does soft-fullscreen work in React, etc.?
- If I want to implement scaled canvas sizing (render at half resolution, etc.), I have to do so on JS-side; emscripten does not provide functions for this
Metadata
Metadata
Assignees
Labels
No labels