diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-23 17:26:02 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-23 17:26:02 -0700 |
commit | bb8e9132fec76a7bfcc8e135ff4c1620971f430f (patch) | |
tree | 99c3aa4f9eaf4c5ff6e35f403f4d53c450a64b89 /src | |
parent | 350550a5ccfacd19f512bca2ded186e143ea9579 (diff) | |
parent | 72d25f1d46f25a6aa4fbaea884bb583cec7332c5 (diff) |
Merge pull request #1726 from juj/sdl_setvideomode_0_0
SDL_SetVideoMode(0,0, ...)
Diffstat (limited to 'src')
-rw-r--r-- | src/library_sdl.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index a0689343..857ab7d4 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -786,6 +786,14 @@ var LibrarySDL = { ['mousedown', 'mouseup', 'mousemove', 'DOMMouseScroll', 'mousewheel', 'mouseout'].forEach(function(event) { Module['canvas'].addEventListener(event, SDL.receiveEvent, true); }); + + // (0,0) means 'use fullscreen' in native; in Emscripten, use the current canvas size. + if (width == 0 && height == 0) { + var canvas = Module['canvas']; + width = canvas.width; + height = canvas.height; + } + Browser.setCanvasSize(width, height, true); // Free the old surface first. if (SDL.screen) { |