diff --git a/src/drivers/Qt/ConsoleViewerSDL.cpp b/src/drivers/Qt/ConsoleViewerSDL.cpp index 7c691607..8199e859 100644 --- a/src/drivers/Qt/ConsoleViewerSDL.cpp +++ b/src/drivers/Qt/ConsoleViewerSDL.cpp @@ -239,18 +239,10 @@ int ConsoleViewSDL_t::init(void) windowHandle = this->winId(); - //printf("Window Handle: %llu \n", windowHandle ); - - //sleep(1); - -#ifdef WIN32 if (sdlWindow == NULL) { sdlWindow = SDL_CreateWindowFrom( (void*)windowHandle); } -#else - sdlWindow = SDL_CreateWindowFrom( (void*)windowHandle); -#endif if (sdlWindow == NULL) { @@ -258,6 +250,8 @@ int ConsoleViewSDL_t::init(void) return -1; } + SDL_ShowWindow( sdlWindow ); + uint32_t baseFlags = vsyncEnabled ? SDL_RENDERER_PRESENTVSYNC : 0; sdlRenderer = SDL_CreateRenderer(sdlWindow, -1, baseFlags | SDL_RENDERER_ACCELERATED); @@ -304,6 +298,11 @@ void ConsoleViewSDL_t::cleanup(void) SDL_DestroyRenderer(sdlRenderer); sdlRenderer = NULL; } + if ( sdlWindow ) + { + SDL_DestroyWindow( sdlWindow ); + sdlWindow = NULL; + } } void ConsoleViewSDL_t::reset(void)