Use SDL_FLAGS variable also in emscripten and ensure it always uses SDL_OPENGL.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5550 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-10-23 21:24:50 +00:00
parent cac82280ee
commit c376454941
1 changed files with 4 additions and 5 deletions

View File

@ -241,8 +241,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
else if (CreationParams.Doublebuffer)
SDL_Flags |= SDL_DOUBLEBUF;
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
else
SDL_Flags = SDL_SWSURFACE;
SDL_Flags |= SDL_OPENGL;
#endif //_IRR_EMSCRIPTEN_PLATFORM_
// create window
@ -287,7 +286,7 @@ bool CIrrDeviceSDL::createWindow()
Width = w;
Height = h;
}
Screen = SDL_SetVideoMode( 0, 0, 32, SDL_OPENGL); // 0,0 will use the canvas size
Screen = SDL_SetVideoMode( 0, 0, 32, SDL_Flags); // 0,0 will use the canvas size
// "#canvas" is for the opengl context
emscripten_set_mousedown_callback("#canvas", (void*)this, true, MouseUpDownCallback);
@ -459,7 +458,7 @@ void CIrrDeviceSDL::createDriver()
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 );
Screen = SDL_SetVideoMode( Width, Height, 32, SDL_Flags );
#else //_IRR_EMSCRIPTEN_PLATFORM_
Screen = SDL_SetVideoMode( Width, Height, 0, SDL_Flags );
#endif //_IRR_EMSCRIPTEN_PLATFOR
@ -663,7 +662,7 @@ bool CIrrDeviceSDL::run()
Width = SDL_event.resize.w;
Height = SDL_event.resize.h;
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
Screen = SDL_SetVideoMode( 0, 0, 32, SDL_OPENGL ); // 0,0 will use the canvas size
Screen = SDL_SetVideoMode( 0, 0, 32, SDL_Flags ); // 0,0 will use the canvas size
#else //_IRR_EMSCRIPTEN_PLATFORM_
Screen = SDL_SetVideoMode( Width, Height, 0, SDL_Flags );
#endif //_IRR_EMSCRIPTEN_PLATFOR