Browse Source

Platform: remove unneeded flag fiddling in Sdl2Application.

The SDL2 documentation explicitly says the following:

    SDL_WINDOW_SHOWN is ignored by SDL_CreateWindow(). The SDL_Window is
    implicitly shown if SDL_WINDOW_HIDDEN is not set.
pull/136/head
Vladimír Vondruš 10 years ago
parent
commit
fedf84a871
  1. 9
      src/Magnum/Platform/Sdl2Application.cpp

9
src/Magnum/Platform/Sdl2Application.cpp

@ -110,11 +110,6 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
SDL_GL_SetAttribute(SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, configuration.isSRGBCapable());
#endif
/* Flags: if not hidden, set as shown */
Uint32 windowFlags(configuration.windowFlags());
if(!(configuration.windowFlags() & Configuration::WindowFlag::Hidden))
windowFlags |= SDL_WINDOW_SHOWN;
/** @todo Remove when Emscripten has proper SDL2 support */
#ifndef CORRADE_TARGET_EMSCRIPTEN
/* Set context version, if user-specified */
@ -172,7 +167,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
#endif
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
configuration.size().x(), configuration.size().y(),
SDL_WINDOW_OPENGL|windowFlags)))
SDL_WINDOW_OPENGL|Uint32(configuration.windowFlags()))))
{
Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create window:" << SDL_GetError();
return false;
@ -218,7 +213,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
if(!(_window = SDL_CreateWindow(configuration.title().data(),
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
configuration.size().x(), configuration.size().y(),
SDL_WINDOW_OPENGL|windowFlags)))
SDL_WINDOW_OPENGL|Uint32(configuration.windowFlags()))))
{
Error() << "Platform::Sdl2Application::tryCreateContext(): cannot create window:" << SDL_GetError();
return false;

Loading…
Cancel
Save