Hi there,
we just landed a new set of functions for managing fullscreen and windowed
mode transitions in Emscripten. This new API consists of the symbols
struct EmscriptenFullscreenStrategy {};
EM_BOOL em_canvasresized_callback_func(...);
emscripten_request_fullscreen_strategy(...);
emscripten_enter_soft_fullscreen(...);
emscripten_exit_soft_fullscreen();
The rationale for these functions is to abstract out various functional
differences between browsers and to add a more high-level API to enable
better control of fullscreen mode configurations, which include:
- CSS size and aspect ratio control
- WebGL render target resolution control
- A soft fullscreen mode which presents a canvas fullscreen without the
fullscreen api
- A unified callback and custom event "canvasresized" that is triggered
when the size of the canvas changes during fullscreen transitions
- Control over image filtering mode in fullscreen (nearest
neighbor/bilinear)
Read https://github.com/kripken/emscripten/issues/2556 for background
information. Also, visit the following pages for live demos of the
different fullscreen modes:
-
https://dl.dropboxusercontent.com/u/40949268/emcc/test_html5_fullscreen/Cube_fs.html
-
https://dl.dropboxusercontent.com/u/40949268/emcc/test_html5_fullscreen/test_html5_fullscreen.html
Because the various workaround for consistent cross browser behavior
require changing the DOM, which might not be suitable for all browser
pages, this new API is carefully written to function as an optional
interface that will be dead-code eliminated away when not used. Also, the
existing function emscripten_request_fullscreen(...) which only performs a
"bare" fullscreen request will continue to work unchanged for those use
cases where developers just want to perform fullscreen transitions without
any extra added logic.
Please test the new API out and let us know if there are any big missing
spots that might require making breaking changes to it. For a usage
example, see
https://github.com/kripken/emscripten/blob/incoming/tests/test_html5_fullscreen.c
and for documentation, see the API reference on html5.h:
http://kripken.github.io/emscripten-site/docs/api_reference/html5.h.html
(source at
https://raw.githubusercontent.com/kripken/emscripten/incoming/site/source/docs/api_reference/html5.h.rst
until a new doc build goes live)
Cheers,
Jukka
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.