From 397a27fbc9b2cc87038eea390df70ba918f43a13 Mon Sep 17 00:00:00 2001 From: cutealien Date: Thu, 20 Jul 2017 15:39:42 +0000 Subject: [PATCH] Remove superfluos call to emscripten_set_canvas_size when handling sdl_resize. This should be the other way round - sdl resize event gets triggered when emscripten_set_canvas_size is called. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5510 dfc29bdd-3216-0410-991c-e03cc46cb475 --- examples/01.HelloWorld_emscripten/main.cpp | 6 ++++-- source/Irrlicht/CIrrDeviceSDL.cpp | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/01.HelloWorld_emscripten/main.cpp b/examples/01.HelloWorld_emscripten/main.cpp index 49f364b4..232d7254 100644 --- a/examples/01.HelloWorld_emscripten/main.cpp +++ b/examples/01.HelloWorld_emscripten/main.cpp @@ -48,7 +48,9 @@ dimension2d screenSize(640, 480); Handle changes in canvas size which are done with html/js. Note that it's only OK for windowed so far, the switch to fullscreen not yet working. -*/ + Also the emscripten_get_canvas_size might cause a slow-down + (but haven't found yet a way to avoid it with SDL1). + */ void checkCanvasResize() { int w, h, fs; @@ -84,7 +86,7 @@ void one_iter() } // In case you have a resizeable canvas (resized from html) - checkCanvasResize(); + //checkCanvasResize(); driver->beginScene(ECBF_COLOR | ECBF_DEPTH, SColor(255,100,101,140)); diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 2dd32144..d2d38360 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -587,7 +587,6 @@ bool CIrrDeviceSDL::run() Width = SDL_event.resize.w; Height = SDL_event.resize.h; #ifdef _IRR_EMSCRIPTEN_PLATFORM_ - emscripten_set_canvas_size( Width, Height); Screen = SDL_SetVideoMode( 0, 0, 32, SDL_OPENGL ); // 0,0 will use the canvas size #else //_IRR_EMSCRIPTEN_PLATFORM_ Screen = SDL_SetVideoMode( Width, Height, 0, SDL_Flags );