GTK: Set GL attributes before creating the SDL window

This apparently helps on the proprietary Nvidia driver.

Thanks @thesourcehim for debugging that!

Fixes #399.

Fixes #400.
This commit is contained in:
Emmanuel Gil Peyrot 2020-11-26 19:41:14 +01:00
parent 91f6e4a9ef
commit 6e35440436
1 changed files with 4 additions and 4 deletions

View File

@ -49,10 +49,6 @@ bool deinit_sdl_3Demu(void)
bool init_sdl_3Demu(void)
{
win = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 256, 192, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN);
if (!win)
return false;
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
@ -64,6 +60,10 @@ bool init_sdl_3Demu(void)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
win = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 256, 192, SDL_WINDOW_OPENGL | SDL_WINDOW_HIDDEN);
if (!win)
return false;
ctx = SDL_GL_CreateContext(win);
if (!ctx)
return false;