Browse Source

Rml::ReleaseTextures can now be called for a single render interface, see #222.

Michael Ragazzon 4 years ago
parent
commit
aa070e7292
2 changed files with 4 additions and 3 deletions
  1. 2 1
      Include/RmlUi/Core/Core.h
  2. 2 2
      Source/Core/Core.cpp

+ 2 - 1
Include/RmlUi/Core/Core.h

@@ -149,7 +149,8 @@ RMLUICORE_API EventId RegisterEventType(const String& type, bool interruptible,
 /// Returns a list of source URLs to textures in all loaded documents.
 RMLUICORE_API StringList GetTextureSourceList();
 /// Forces all texture handles loaded and generated by RmlUi to be released.
-RMLUICORE_API void ReleaseTextures();
+/// @param[in] render_interface Release all textures belonging to the given interface, or nullptr to release all textures in all interfaces.
+RMLUICORE_API void ReleaseTextures(RenderInterface* render_interface = nullptr);
 /// Forces all compiled geometry handles generated by RmlUi to be released.
 RMLUICORE_API void ReleaseCompiledGeometry();
 

+ 2 - 2
Source/Core/Core.cpp

@@ -361,9 +361,9 @@ StringList GetTextureSourceList()
 	return TextureDatabase::GetSourceList();
 }
 
-void ReleaseTextures()
+void ReleaseTextures(RenderInterface* in_render_interface)
 {
-	TextureDatabase::ReleaseTextures();
+	TextureDatabase::ReleaseTextures(in_render_interface);
 }
 
 void ReleaseCompiledGeometry()