Bugfix: Inform videodriver about new size when created by getting size from canvas (on emscripten).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5509 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-07-20 13:21:05 +00:00
parent 7f190b80cd
commit 3304309867
1 changed files with 11 additions and 0 deletions

View File

@ -386,6 +386,17 @@ void CIrrDeviceSDL::createDriver()
os::Printer::log("Unable to create video driver of unknown type.", ELL_ERROR);
break;
}
// In case we got the size from the canvas
if ( VideoDriver && CreationParams.WindowSize.Width == 0 && CreationParams.WindowSize.Height == 0 && Width > 0 && Height > 0 )
{
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
Screen = SDL_SetVideoMode( Width, Height, 32, SDL_OPENGL );
#else //_IRR_EMSCRIPTEN_PLATFORM_
Screen = SDL_SetVideoMode( Width, Height, 0, SDL_Flags );
#endif //_IRR_EMSCRIPTEN_PLATFOR
VideoDriver->OnResize(core::dimension2d<u32>(Width, Height));
}
}