mirror of
https://github.com/ocornut/imgui.git
synced 2026-09-29 04:35:49 +03:00
Fonts: proof of concept support for user textures.
# Conflicts: # imgui.h # imgui_internal.h
This commit is contained in:
parent
91ed6e67b4
commit
39f6c793b3
3 changed files with 22 additions and 1 deletions
15
imgui.cpp
15
imgui.cpp
|
|
@ -5231,6 +5231,8 @@ static void ImGui::UpdateTexturesEndFrame()
|
|||
tex->RefCount = (unsigned short)atlas->RefCount;
|
||||
g.PlatformIO.Textures.push_back(tex);
|
||||
}
|
||||
for (ImTextureData* tex : g.UserTextures)
|
||||
g.PlatformIO.Textures.push_back(tex);
|
||||
}
|
||||
|
||||
// Called once a frame. Followed by SetCurrentFont() which sets up the remaining data.
|
||||
|
|
@ -8613,6 +8615,19 @@ void ImGui::UpdateFontsEndFrame()
|
|||
PopFont();
|
||||
}
|
||||
|
||||
void ImGui::RegisterUserTexture(ImTextureData* tex)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
IM_ASSERT(tex->RefCount > 0);
|
||||
g.UserTextures.push_back(tex);
|
||||
}
|
||||
|
||||
void ImGui::UnregisterUserTexture(ImTextureData* tex)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
g.UserTextures.find_erase(tex);
|
||||
}
|
||||
|
||||
void ImGui::RegisterFontAtlas(ImFontAtlas* atlas)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue