Fixed SDL video init for linux, force window to be reshown after calling SDL_DestroyWindow as the destroy calls hide.
This commit is contained in:
parent
cdf2f1e150
commit
2861067933
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue