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:
Alug committed 2025-11-25 16:38:19 +01:00
1 parent 4a4e668d21
commit a01cd628ab
3 files changed
+16 -3

No files matched your search

+1
View File
@@ -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
View File
@@ -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
View File
@@ -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)
{