mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-02 18:14:32 +00:00
Fonts: detect if ImFontAtlasUpdateNewFrame() is not being called.
This commit is contained in:
@@ -2715,11 +2715,14 @@ static void ImFontAtlasBuildUpdateRendererHasTexturesFromContext(ImFontAtlas* at
|
||||
}
|
||||
}
|
||||
|
||||
// Called by NewFrame(). When multiple context own the atlas, only the first one calls this.
|
||||
// If you are calling this yourself, ensure atlas->RendererHasTextures is set.
|
||||
// Called by NewFrame() for atlases owned by a context.
|
||||
// If you manually manage font atlases, you'll need to call this yourself + ensure atlas->RendererHasTextures is set.
|
||||
// 'frame_count' needs to be provided because we can gc/prioritize baked fonts based on their age.
|
||||
// 'frame_count' may not match those of imgui contexts using this atlas, as contexts may be updated as different frequencies.
|
||||
void ImFontAtlasUpdateNewFrame(ImFontAtlas* atlas, int frame_count)
|
||||
{
|
||||
IM_ASSERT(atlas->Builder == NULL || atlas->Builder->FrameCount < frame_count); // Protection against being called twice?
|
||||
|
||||
// Check that font atlas was built or backend support texture reload in which case we can build now
|
||||
if (atlas->RendererHasTextures)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user