SDL window initialization and resize logic fix. Should only be calling SDL_CreateWindowFrom once. Wait for window to full be created and initialized before attempting to init SDL video renderer.

This commit is contained in:
mjbudd77 2021-06-10 23:06:43 -04:00
parent d146718204
commit 72de93bc94
2 changed files with 7 additions and 2 deletions

View File

@ -236,7 +236,11 @@ int ConsoleViewSDL_t::init(void)
//sleep(1);
sdlWindow = SDL_CreateWindowFrom( (void*)windowHandle);
if (sdlWindow == NULL)
{
sdlWindow = SDL_CreateWindowFrom( (void*)windowHandle);
}
if (sdlWindow == NULL)
{
printf("[SDL] Failed to create window from handle.\n");

View File

@ -122,7 +122,8 @@ int main( int argc, char *argv[] )
consoleWindow->show();
consoleWindow->videoInit();
// Need to wait for window to initialize before video init can be called.
//consoleWindow->videoInit();
#ifdef WIN32
// This function is needed to fix the issue referenced below. It adds a 1-pixel border