From fedf84a871d418c490a1df8b3f00f05909dea051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 15 Feb 2016 21:41:36 +0100 Subject: [PATCH] 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. --- src/Magnum/Platform/Sdl2Application.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Platform/Sdl2Application.cpp b/src/Magnum/Platform/Sdl2Application.cpp index 37e0c3b20..c8ac7ace5 100644 --- a/src/Magnum/Platform/Sdl2Application.cpp +++ b/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;