@ -272,8 +272,13 @@ bool Sdl2Application::tryCreate(const Configuration& configuration, const GLConf
GLConfiguration glConfiguration { _glConfiguration } ;
CORRADE_IGNORE_DEPRECATED_PUSH
# ifndef CORRADE_TARGET_EMSCRIPTEN
# ifndef MAGNUM_TARGET_GLES
if ( configuration . flags ( ) & & glConfiguration . flags ( ) = = GLConfiguration : : Flag : : ForwardCompatible )
glConfiguration . setFlags ( configuration . flags ( ) | GLConfiguration : : Flag : : ForwardCompatible ) ;
# else
if ( configuration . flags ( ) & & ! glConfiguration . flags ( ) )
glConfiguration . setFlags ( configuration . flags ( ) ) ;
# endif
if ( configuration . version ( ) ! = GL : : Version : : None & & glConfiguration . version ( ) = = GL : : Version : : None )
glConfiguration . setVersion ( configuration . version ( ) ) ;
# endif
@ -343,7 +348,7 @@ bool Sdl2Application::tryCreate(const Configuration& configuration, const GLConf
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_MINOR_VERSION , 1 ) ;
# endif
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_PROFILE_MASK , SDL_GL_CONTEXT_PROFILE_CORE ) ;
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_FLAGS , int ( glConfiguration . flags ( ) ) | SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG ) ;
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_FLAGS , int ( glConfiguration . flags ( ) ) ) ;
# else
/* For ES the major context version is compile-time constant */
# ifdef MAGNUM_TARGET_GLES3
@ -416,7 +421,8 @@ bool Sdl2Application::tryCreate(const Configuration& configuration, const GLConf
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_MAJOR_VERSION , 2 ) ;
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_MINOR_VERSION , 1 ) ;
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_PROFILE_MASK , SDL_GL_CONTEXT_PROFILE_COMPATIBILITY ) ;
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_FLAGS , int ( glConfiguration . flags ( ) ) ) ;
/** @todo or keep the fwcompat? */
SDL_GL_SetAttribute ( SDL_GL_CONTEXT_FLAGS , int ( glConfiguration . flags ( ) & ~ GLConfiguration : : Flag : : ForwardCompatible ) ) ;
if ( ! ( _window = SDL_CreateWindow ( configuration . title ( ) . data ( ) ,
SDL_WINDOWPOS_UNDEFINED , SDL_WINDOWPOS_UNDEFINED ,
@ -839,7 +845,13 @@ Sdl2Application::GLConfiguration::GLConfiguration():
_colorBufferSize { 8 , 8 , 8 , 0 } , _depthBufferSize { 24 } , _stencilBufferSize { 0 } ,
_sampleCount ( 0 )
# ifndef CORRADE_TARGET_EMSCRIPTEN
, _version ( GL : : Version : : None ) , _srgbCapable { false }
, _version ( GL : : Version : : None ) ,
# ifndef MAGNUM_TARGET_GLES
_flags { Flag : : ForwardCompatible } ,
# else
_flags { } ,
# endif
_srgbCapable { false }
# endif
{ }
@ -859,6 +871,9 @@ Sdl2Application::Configuration::Configuration():
# if defined(MAGNUM_BUILD_DEPRECATED) && defined(MAGNUM_TARGET_GL)
, _sampleCount ( 0 )
# ifndef CORRADE_TARGET_EMSCRIPTEN
/* Deliberately not setting _flags to ForwardCompatible to avoid them
having higher priority over GLConfiguration flags , appending that flag
later */
, _version ( GL : : Version : : None ) , _srgbCapable { false }
# endif
# endif