Fix SDL surface backend texture refresh

This commit is contained in:
moonpower
2026-04-02 14:03:42 +02:00
parent ff2f9ae4e6
commit e7ca13b714
+3 -2
View File
@@ -975,7 +975,7 @@ bool ImGui_ImplSDLSurface2_Init(SDL_Surface* surface)
ImGui_ImplSDLSurface2_InitSurfaceInfo(&bd->TargetInfo, surface);
bd->FontSurface = ImGui_ImplSDLSurface2_CreateFontAtlasSurface();
if (bd->FontSurface != nullptr)
io.Fonts->TexID = (ImTextureID)bd->FontSurface;
io.Fonts->SetTexID((ImTextureID)bd->FontSurface);
return true;
}
@@ -987,7 +987,8 @@ void ImGui_ImplSDLSurface2_Shutdown()
ImGuiIO& io = ImGui::GetIO();
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
io.Fonts->TexID = nullptr;
if (io.Fonts->TexData != nullptr)
io.Fonts->TexData->SetTexID(ImTextureID_Invalid);
io.BackendRendererName = nullptr;
io.BackendRendererUserData = nullptr;
platform_io.ClearRendererHandlers();