Backends: Using SetTexID() consistently instead of assigning to ->TexID. May make the later obsolete eventually.

This commit is contained in:
ocornut
2021-02-03 18:30:26 +01:00
parent 82a9b599ab
commit 58a0a7058c
12 changed files with 25 additions and 24 deletions

View File

@ -470,7 +470,7 @@ bool ImGui_ImplOpenGL3_CreateFontsTexture()
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
// Store our identifier
io.Fonts->TexID = (ImTextureID)(intptr_t)g_FontTexture;
io.Fonts->SetTexID((ImTextureID)(intptr_t)g_FontTexture);
// Restore state
glBindTexture(GL_TEXTURE_2D, last_texture);
@ -484,7 +484,7 @@ void ImGui_ImplOpenGL3_DestroyFontsTexture()
{
ImGuiIO& io = ImGui::GetIO();
glDeleteTextures(1, &g_FontTexture);
io.Fonts->TexID = 0;
io.Fonts->SetTexID(0);
g_FontTexture = 0;
}
}