mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
VID_SetMode: for SDL2, move GL context creation to be after the window is shown.
This matches the order used in the SDL2 sample applications included with the library. Seems to fix an issue on Windows 10 with DPI scaling 150%, launching QS 0.90.1 with "-width 1920 -height 1080 -fullscreen", and you get a horrible black flicker every few frames. see http://celephais.net/board/view_thread.php?id=60452&start=1587 git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1249 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
0e8f1f393b
commit
5b158a2807
1 changed files with 7 additions and 4 deletions
|
@ -588,10 +588,6 @@ static qboolean VID_SetMode (int width, int height, int bpp, qboolean fullscreen
|
|||
}
|
||||
if (!draw_context)
|
||||
Sys_Error ("Couldn't create window");
|
||||
|
||||
gl_context = SDL_GL_CreateContext (draw_context);
|
||||
if (!gl_context)
|
||||
Sys_Error ("Couldn't create GL context");
|
||||
}
|
||||
|
||||
/* Ensure the window is not fullscreen */
|
||||
|
@ -618,6 +614,13 @@ static qboolean VID_SetMode (int width, int height, int bpp, qboolean fullscreen
|
|||
|
||||
SDL_ShowWindow (draw_context);
|
||||
|
||||
/* Create GL context if needed */
|
||||
if (!gl_context) {
|
||||
gl_context = SDL_GL_CreateContext(draw_context);
|
||||
if (!gl_context)
|
||||
Sys_Error("Couldn't create GL context");
|
||||
}
|
||||
|
||||
gl_swap_control = true;
|
||||
if (SDL_GL_SetSwapInterval ((vid_vsync.value) ? 1 : 0) == -1)
|
||||
gl_swap_control = false;
|
||||
|
|
Loading…
Reference in a new issue