do some more cleanup when shutting down graphics system
make sure we free all our opengl allocated stuff by calling HWR_Shutdown make sure we also destroy our sdl texture, renderer and window if the exist
This commit is contained in:
1 parent
4a4e668d21
commit
a01cd628ab
3 files changed
+16
-3
No files matched your search
@@ -5903,6 +5903,7 @@ void HWR_Shutdown(void)
|
||||
HWR_FreeExtraSubsectors();
|
||||
HWR_FreeMapTextures();
|
||||
GL_FlushScreenTextures();
|
||||
HWR_ClearAllTextures();
|
||||
#ifdef USE_FBO_OGL
|
||||
GL_Framebuffer_Disable();
|
||||
#endif
|
||||
|
||||
+14
-2
@@ -1999,12 +1999,24 @@ void I_ShutdownGraphics(void)
|
||||
I_OutputMsg("shut down\n");
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (vid.glstate == VID_GL_LIBRARY_LOADED)
|
||||
HWR_Shutdown();
|
||||
|
||||
if (sdlglcontext)
|
||||
{
|
||||
SDL_GL_DeleteContext(sdlglcontext);
|
||||
}
|
||||
sdlglcontext = NULL;
|
||||
#endif
|
||||
|
||||
if (texture)
|
||||
SDL_DestroyTexture(texture);
|
||||
texture = NULL;
|
||||
if (renderer)
|
||||
SDL_DestroyRenderer(renderer);
|
||||
renderer = NULL;
|
||||
if (window)
|
||||
SDL_DestroyWindow(window);
|
||||
window = NULL;
|
||||
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||
framebuffer = SDL_FALSE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ boolean UseScreenFBO(void)
|
||||
/** \brief SDL video display surface
|
||||
*/
|
||||
INT32 oglflags = 0;
|
||||
SDL_GLContext sdlglcontext = 0;
|
||||
SDL_GLContext sdlglcontext = NULL;
|
||||
|
||||
void *GetGLFunc(const char *proc)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user