mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-20 03:47:11 +00:00
Fonts: proof of concept support for user textures.
# Conflicts: # imgui.h # imgui_internal.h
This commit is contained in:
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;
|
||||
|
||||
Reference in New Issue
Block a user