ImFontAtlas: made calling ClearFonts() call ClearInputData(). (#8174, #6556, #6336, #4723)
build / Windows (push) Has been cancelled
build / Linux (push) Has been cancelled
build / MacOS (push) Has been cancelled
build / iOS (push) Has been cancelled
build / Emscripten (push) Has been cancelled
build / Android (push) Has been cancelled

This commit is contained in:
ocornut
2025-01-23 11:31:32 +01:00
parent 71da34c48c
commit 10199341b1
3 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -54,7 +54,6 @@ Breaking changes:
Other changes: Other changes:
- ImDrawList: texture baked storage for thick line reduced from ~64x64 to ~32x32. (#3245)
- imgui_freetype: fixed issue where glyph advances would incorrectly be - imgui_freetype: fixed issue where glyph advances would incorrectly be
snapped to pixels. Effectively it would only be noticeable when hinting snapped to pixels. Effectively it would only be noticeable when hinting
is disabled with ImGuiFreeTypeBuilderFlags_NoHinting, as hinting itself is disabled with ImGuiFreeTypeBuilderFlags_NoHinting, as hinting itself
@@ -74,6 +73,9 @@ Other changes:
increased default rounding (style.TabRounding). (#8334) [@Kian738, @ocornut] increased default rounding (style.TabRounding). (#8334) [@Kian738, @ocornut]
styles as the current look is not right (but ImGuiCol_TabSelectedOverline stays the same). styles as the current look is not right (but ImGuiCol_TabSelectedOverline stays the same).
- Debug Tools: Tweaked font preview. - Debug Tools: Tweaked font preview.
- ImDrawList: texture baked storage for thick line reduced from ~64x64 to ~32x32. (#3245)
- ImFontAtlas: made calling ClearFonts() call ClearInputData(), as calling
one without the other is never correct. (#8174, #6556, #6336, #4723)
- Examples: DirectX12: Reduced number of frame in flight from 3 to 2 in - Examples: DirectX12: Reduced number of frame in flight from 3 to 2 in
provided example, to reduce latency. provided example, to reduce latency.
- Examples: Vulkan: better handle VK_SUBOPTIMAL_KHR being returned by - Examples: Vulkan: better handle VK_SUBOPTIMAL_KHR being returned by
+1 -1
View File
@@ -3355,8 +3355,8 @@ struct ImFontAtlas
IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_data_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp. IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* compressed_font_data, int compressed_font_data_size, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data' still owned by caller. Compress with binary_to_compressed_c.cpp.
IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_font_data_base85, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter. IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(const char* compressed_font_data_base85, float size_pixels, const ImFontConfig* font_cfg = NULL, const ImWchar* glyph_ranges = NULL); // 'compressed_font_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 parameter.
IMGUI_API void ClearInputData(); // Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts. IMGUI_API void ClearInputData(); // Clear input data (all ImFontConfig structures including sizes, TTF data, glyph ranges, etc.) = all the data used to build the texture and fonts.
IMGUI_API void ClearFonts(); // Clear input+output font data (same as ClearInputData() + glyphs storage, UV coordinates).
IMGUI_API void ClearTexData(); // Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory. IMGUI_API void ClearTexData(); // Clear output texture data (CPU side). Saves RAM once the texture has been copied to graphics memory.
IMGUI_API void ClearFonts(); // Clear output font data (glyphs storage, UV coordinates).
IMGUI_API void Clear(); // Clear all input and output. IMGUI_API void Clear(); // Clear all input and output.
// Build atlas, retrieve pixel data. // Build atlas, retrieve pixel data.
+1
View File
@@ -2520,6 +2520,7 @@ void ImFontAtlas::ClearTexData()
void ImFontAtlas::ClearFonts() void ImFontAtlas::ClearFonts()
{ {
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!"); IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas between NewFrame() and EndFrame/Render()!");
ClearInputData();
Fonts.clear_delete(); Fonts.clear_delete();
TexReady = false; TexReady = false;
} }