From 528a5eb218d681b5f3a06bac9d3eea7e8c95fcc8 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Sun, 15 Feb 2026 14:00:28 -0500 Subject: [PATCH] Try hack to fix windows renderer freeze during gl->software --- src/sdl/i_video.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/sdl/i_video.cpp b/src/sdl/i_video.cpp index 4b8b37448..b72cf678f 100644 --- a/src/sdl/i_video.cpp +++ b/src/sdl/i_video.cpp @@ -248,10 +248,6 @@ static bool Impl_RenderContextReset(void) if (renderer) { SDL_DestroyRenderer(renderer); -// Thanks Debian.... -#if SDL_VERSION_ATLEAST(2,28,0) - SDL_DestroyWindowSurface(window); // workaround for a bug in sdl -#endif texture = NULL; // Destroying a renderer also destroys all of its textures } renderer = NULL; @@ -293,8 +289,19 @@ static void Impl_SetSoftwareVsync(int vsync) static void Impl_VideoSetupSurfaces(int width, int height) { - if (texture == NULL) - texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STREAMING, width, height); + if (texture) + { + SDL_DestroyTexture(texture); + texture = NULL; + } + + texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STREAMING, width, height); + + if (!texture) + { + I_Error("Failed to setup video surface"); + } + SDL_SetTextureScaleMode(texture, SDL_SCALEMODE_NEAREST); }