mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Destroy the window after the GL context.
The GL context is bound to a window, so destroy it before the window and not after it. While here update the header comment.
This commit is contained in:
parent
98a83e2322
commit
68d3da29e8
1 changed files with 7 additions and 3 deletions
|
@ -19,13 +19,17 @@
|
|||
* 02111-1307, USA.
|
||||
*
|
||||
* ----------------------------------------------------------------------
|
||||
*
|
||||
* CalculateGammaRamp() is derived from SDL2's SDL_CalculateGammaRamp()
|
||||
* (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
|
||||
* Published under zlib License: http://www.libsdl.org/license.php
|
||||
*
|
||||
* =======================================================================
|
||||
*
|
||||
* This file implements an OpenGL context via SDL
|
||||
* This file implements an OpenGL context and window handling through
|
||||
* SDL. The code is complicated by supporting the fairly different SDL
|
||||
* 1.2 and SDL 2 APIs, each with hardware gamma or software gamma by
|
||||
* RANDR.
|
||||
*
|
||||
* =======================================================================
|
||||
*/
|
||||
|
@ -738,13 +742,13 @@ GLimp_Shutdown(void)
|
|||
if (window)
|
||||
{
|
||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||
SDL_DestroyWindow(window);
|
||||
|
||||
if(context)
|
||||
{
|
||||
SDL_GL_DeleteContext(context);
|
||||
context = NULL;
|
||||
}
|
||||
|
||||
SDL_DestroyWindow(window);
|
||||
#else
|
||||
SDL_FreeSurface(window);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue