Fix SDL surface backend texture refresh
This commit is contained in:
@@ -975,7 +975,7 @@ bool ImGui_ImplSDLSurface2_Init(SDL_Surface* surface)
|
|||||||
ImGui_ImplSDLSurface2_InitSurfaceInfo(&bd->TargetInfo, surface);
|
ImGui_ImplSDLSurface2_InitSurfaceInfo(&bd->TargetInfo, surface);
|
||||||
bd->FontSurface = ImGui_ImplSDLSurface2_CreateFontAtlasSurface();
|
bd->FontSurface = ImGui_ImplSDLSurface2_CreateFontAtlasSurface();
|
||||||
if (bd->FontSurface != nullptr)
|
if (bd->FontSurface != nullptr)
|
||||||
io.Fonts->TexID = (ImTextureID)bd->FontSurface;
|
io.Fonts->SetTexID((ImTextureID)bd->FontSurface);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -987,7 +987,8 @@ void ImGui_ImplSDLSurface2_Shutdown()
|
|||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
|
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
|
||||||
|
|
||||||
io.Fonts->TexID = nullptr;
|
if (io.Fonts->TexData != nullptr)
|
||||||
|
io.Fonts->TexData->SetTexID(ImTextureID_Invalid);
|
||||||
io.BackendRendererName = nullptr;
|
io.BackendRendererName = nullptr;
|
||||||
io.BackendRendererUserData = nullptr;
|
io.BackendRendererUserData = nullptr;
|
||||||
platform_io.ClearRendererHandlers();
|
platform_io.ClearRendererHandlers();
|
||||||
|
|||||||
Reference in New Issue
Block a user