| 8955 | //----------------------------------------------------------------------------- |
| 8956 | |
| 8957 | static void ImGui::UpdateTexturesNewFrame() |
| 8958 | { |
| 8959 | // Cannot update every atlases based on atlas's FrameCount < g.FrameCount, because an atlas may be shared by multiple contexts with different frame count. |
| 8960 | ImGuiContext& g = *GImGui; |
| 8961 | const bool has_textures = (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasTextures) != 0; |
| 8962 | for (ImFontAtlas* atlas : g.FontAtlases) |
| 8963 | { |
| 8964 | if (atlas->OwnerContext == &g) |
| 8965 | { |
| 8966 | ImFontAtlasUpdateNewFrame(atlas, g.FrameCount, has_textures); |
| 8967 | } |
| 8968 | else |
| 8969 | { |
| 8970 | // (1) If you manage font atlases yourself, e.g. create a ImFontAtlas yourself you need to call ImFontAtlasUpdateNewFrame() on it. |
| 8971 | // Otherwise, calling ImGui::CreateContext() without parameter will create an atlas owned by the context. |
| 8972 | // (2) If you have multiple font atlases, make sure the 'atlas->RendererHasTextures' as specified in the ImFontAtlasUpdateNewFrame() call matches for that. |
| 8973 | // (3) If you have multiple imgui contexts, they also need to have a matching value for ImGuiBackendFlags_RendererHasTextures. |
| 8974 | IM_ASSERT(atlas->Builder != NULL && atlas->Builder->FrameCount != -1); |
| 8975 | IM_ASSERT(atlas->RendererHasTextures == has_textures); |
| 8976 | } |
| 8977 | } |
| 8978 | } |
| 8979 | |
| 8980 | // Build a single texture list |
| 8981 | static void ImGui::UpdateTexturesEndFrame() |
nothing calls this directly
no test coverage detected