added function to free all textures
authorHolger Schemel <holger.schemel@virtion.de>
Mon, 9 Dec 2024 18:32:56 +0000 (19:32 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Mon, 9 Dec 2024 12:33:15 +0000 (13:33 +0100)
src/init.c
src/init.h
src/tools.c

index 1355af88d81cf412135b49458c455bb98e58f17d..04d55b8bfd8369184155f353faed43fe104718e5 100644 (file)
@@ -449,6 +449,11 @@ void InitImageTextures(void)
     CreateImageTextures(texture_graphics[i]);
 }
 
+void FreeAllTextures(void)
+{
+  FreeAllImageTextures();
+}
+
 static int getFontSpecialSuffix(void)
 {
   int special = -1;
index 9479f0f842c1128d9748ced07e8a0df5d6bd5b91..517bf7d3b571627f790652866ababad32d6c3eff 100644 (file)
@@ -39,6 +39,7 @@ void KeyboardAutoRepeatOffUnlessAutoplay(void);
 void InitGfxBuffers(void);
 void InitGadgets(void);
 void InitImageTextures(void);
+void FreeAllTextures(void);
 
 boolean anyImagehasColorTemplate(void);
 void InitColorTemplateImages(void);
index a20fc51a81f9615c93f78bda7d74601dd8ba83c9..1fdc53e91dcd48fab3be416bbc5f5b7c8f75d7b5 100644 (file)
@@ -11951,7 +11951,7 @@ void ChangeVsyncModeIfNeeded(void)
     video.fullscreen_enabled = !setup.fullscreen;
 
     // when creating new renderer, destroy textures linked to old renderer
-    FreeAllImageTextures();    // needs old renderer to free the textures
+    FreeAllTextures();         // needs old renderer to free the textures
 
     // re-create screen and renderer (including change of vsync mode)
     ChangeVideoModeIfNeeded(setup.fullscreen);
@@ -12304,7 +12304,7 @@ void ChangeViewportPropertiesIfNeeded(void)
   {
     // Debug("tools:viewport", "init_video_buffer");
 
-    FreeAllImageTextures();    // needs old renderer to free the textures
+    FreeAllTextures();         // needs old renderer to free the textures
 
     InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen);
     InitImageTextures();