1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-12-18 18:46:13 +01:00

Merge branch 'master' into docking

This commit is contained in:
ocornut 2024-12-11 15:08:31 +01:00
commit 947aa9c972
9 changed files with 32 additions and 32 deletions

View File

@ -36,7 +36,7 @@ HOW TO UPDATE?
- Please report any issue! - Please report any issue!
----------------------------------------------------------------------- -----------------------------------------------------------------------
VERSION 1.91.6 WIP (In Progress) VERSION 1.91.6 (Released 2024-12-11)
----------------------------------------------------------------------- -----------------------------------------------------------------------
Breaking changes: Breaking changes:
@ -71,12 +71,12 @@ Other changes:
- Misc: changed embedded ProggyClean encoding to save a bit of binary space (~12kb to 9.5kb). - Misc: changed embedded ProggyClean encoding to save a bit of binary space (~12kb to 9.5kb).
- Misc: added IMGUI_DISABLE_DEFAULT_FONT to strip embedded font from binary. (#8161) - Misc: added IMGUI_DISABLE_DEFAULT_FONT to strip embedded font from binary. (#8161)
[@demonese] [@demonese]
- Tools: binary_to_compressed_c: added -u8/-u32/-base85 export options.
- Demo: example tree used by Property Editor & Selection demos properly freed - Demo: example tree used by Property Editor & Selection demos properly freed
on application closure. (#8158) [@Legulysse] on application closure. (#8158) [@Legulysse]
- Fonts: fixed AddCustomRect() not being packed with TexGlyphPadding + not accounted - Fonts: fixed AddCustomRect() not being packed with TexGlyphPadding + not accounted
for surface area used to determine best-guess texture size. (#8107) [@YarikTH, @ocornut] for surface area used to determine best-guess texture size. (#8107) [@YarikTH, @ocornut]
- Misc: use SSE 4.2 crc32 instructions when available. (#8169, #4933) [@Teselka] - Misc: use SSE 4.2 crc32 instructions when available. (#8169, #4933) [@Teselka]
- Tools: binary_to_compressed_c: added -u8/-u32/-base85 export options.
- Backends: DirectX12: Let user specifies the DepthStencilView format by setting - Backends: DirectX12: Let user specifies the DepthStencilView format by setting
ImGui_ImplDX12_InitInfo::DSVFormat. (#8217) [@bmarques1995] ImGui_ImplDX12_InitInfo::DSVFormat. (#8217) [@bmarques1995]
- Backends: Vulkan: Make user-provided descriptor pool optional. As a convenience, - Backends: Vulkan: Make user-provided descriptor pool optional. As a convenience,

View File

@ -110,7 +110,7 @@ Reading the changelogs is a good way to keep up to date with the things Dear ImG
Calling the `ImGui::ShowDemoWindow()` function will create a demo window showcasing a variety of features and examples. The code is always available for reference in `imgui_demo.cpp`. [Here's how the demo looks](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v167/v167-misc.png). Calling the `ImGui::ShowDemoWindow()` function will create a demo window showcasing a variety of features and examples. The code is always available for reference in `imgui_demo.cpp`. [Here's how the demo looks](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v167/v167-misc.png).
You should be able to build the examples from sources. If you don't, let us know! If you want to have a quick look at some Dear ImGui features, you can download Windows binaries of the demo app here: You should be able to build the examples from sources. If you don't, let us know! If you want to have a quick look at some Dear ImGui features, you can download Windows binaries of the demo app here:
- [imgui-demo-binaries-20240105.zip](https://www.dearimgui.com/binaries/imgui-demo-binaries-20240105.zip) (Windows, 1.90.1 WIP, built 2024/01/05, master) or [older binaries](https://www.dearimgui.com/binaries). - [imgui-demo-binaries-20241211.zip](https://www.dearimgui.com/binaries/imgui-demo-binaries-20241211.zip) (Windows, 1.91.6, built 2024/11/11, master) or [older binaries](https://www.dearimgui.com/binaries).
The demo applications are not DPI aware so expect some blurriness on a 4K screen. For DPI awareness in your application, you can load/reload your font at a different scale and scale your style with `style.ScaleAllSizes()` (see [FAQ](https://www.dearimgui.com/faq)). The demo applications are not DPI aware so expect some blurriness on a 4K screen. For DPI awareness in your application, you can load/reload your font at a different scale and scale your style with `style.ScaleAllSizes()` (see [FAQ](https://www.dearimgui.com/faq)).

View File

@ -1,4 +1,4 @@
// dear imgui, v1.91.6 WIP // dear imgui, v1.91.6
// (main code and documentation) // (main code and documentation)
// Help: // Help:
@ -4855,15 +4855,15 @@ void ImGui::DebugAllocHook(ImGuiDebugAllocInfo* info, int frame_count, void* ptr
} }
if (size != (size_t)-1) if (size != (size_t)-1)
{ {
//printf("[%05d] MemAlloc(%d) -> 0x%p\n", frame_count, (int)size, ptr);
entry->AllocCount++; entry->AllocCount++;
info->TotalAllocCount++; info->TotalAllocCount++;
//printf("[%05d] MemAlloc(%d) -> 0x%p\n", frame_count, size, ptr);
} }
else else
{ {
//printf("[%05d] MemFree(0x%p)\n", frame_count, ptr);
entry->FreeCount++; entry->FreeCount++;
info->TotalFreeCount++; info->TotalFreeCount++;
//printf("[%05d] MemFree(0x%p)\n", frame_count, ptr);
} }
} }

16
imgui.h
View File

@ -1,4 +1,4 @@
// dear imgui, v1.91.6 WIP // dear imgui, v1.91.6
// (headers) // (headers)
// Help: // Help:
@ -28,8 +28,8 @@
// Library Version // Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345') // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.91.6 WIP" #define IMGUI_VERSION "1.91.6"
#define IMGUI_VERSION_NUM 19154 #define IMGUI_VERSION_NUM 19160
#define IMGUI_HAS_TABLE #define IMGUI_HAS_TABLE
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch #define IMGUI_HAS_VIEWPORT // Viewport WIP branch
#define IMGUI_HAS_DOCK // Docking WIP branch #define IMGUI_HAS_DOCK // Docking WIP branch
@ -3544,24 +3544,24 @@ struct ImFontAtlas
// ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32(). // ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
struct ImFont struct ImFont
{ {
// Members: Hot ~20/24 bytes (for CalcTextSize) // [Internal] Members: Hot ~20/24 bytes (for CalcTextSize)
ImVector<float> IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI). ImVector<float> IndexAdvanceX; // 12-16 // out // // Sparse. Glyphs->AdvanceX in a directly indexable way (cache-friendly for CalcTextSize functions which only this info, and are often bottleneck in large UI).
float FallbackAdvanceX; // 4 // out // = FallbackGlyph->AdvanceX float FallbackAdvanceX; // 4 // out // = FallbackGlyph->AdvanceX
float FontSize; // 4 // in // // Height of characters/line, set during loading (don't change after loading) float FontSize; // 4 // in // // Height of characters/line, set during loading (don't change after loading)
// Members: Hot ~28/40 bytes (for CalcTextSize + render loop) // [Internal] Members: Hot ~28/40 bytes (for RenderText loop)
ImVector<ImWchar> IndexLookup; // 12-16 // out // // Sparse. Index glyphs by Unicode code-point. ImVector<ImWchar> IndexLookup; // 12-16 // out // // Sparse. Index glyphs by Unicode code-point.
ImVector<ImFontGlyph> Glyphs; // 12-16 // out // // All glyphs. ImVector<ImFontGlyph> Glyphs; // 12-16 // out // // All glyphs.
const ImFontGlyph* FallbackGlyph; // 4-8 // out // = FindGlyph(FontFallbackChar) const ImFontGlyph* FallbackGlyph; // 4-8 // out // = FindGlyph(FontFallbackChar)
// Members: Cold ~32/40 bytes // [Internal] Members: Cold ~32/40 bytes
// Conceptually ConfigData[] is the list of font sources merged to create this font. // Conceptually ConfigData[] is the list of font sources merged to create this font.
ImFontAtlas* ContainerAtlas; // 4-8 // out // // What we has been loaded into ImFontAtlas* ContainerAtlas; // 4-8 // out // // What we has been loaded into
const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData to ConfigDataCount instances const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData to ConfigDataCount instances
short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont. short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
ImWchar FallbackChar; // 2 // out // = FFFD/'?' // Character used if a glyph isn't found.
ImWchar EllipsisChar; // 2 // out // = '...'/'.'// Character used for ellipsis rendering.
short EllipsisCharCount; // 1 // out // 1 or 3 short EllipsisCharCount; // 1 // out // 1 or 3
ImWchar EllipsisChar; // 2-4 // out // = '...'/'.'// Character used for ellipsis rendering.
ImWchar FallbackChar; // 2-4 // out // = FFFD/'?' // Character used if a glyph isn't found.
float EllipsisWidth; // 4 // out // Width float EllipsisWidth; // 4 // out // Width
float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0 float EllipsisCharStep; // 4 // out // Step between characters when EllipsisCount > 0
bool DirtyLookupTables; // 1 // out // bool DirtyLookupTables; // 1 // out //

View File

@ -1,4 +1,4 @@
// dear imgui, v1.91.6 WIP // dear imgui, v1.91.6
// (demo code) // (demo code)
// Help: // Help:
@ -10695,6 +10695,8 @@ void ImGui::ShowAboutWindow(bool*) {}
void ImGui::ShowDemoWindow(bool*) {} void ImGui::ShowDemoWindow(bool*) {}
void ImGui::ShowUserGuide() {} void ImGui::ShowUserGuide() {}
void ImGui::ShowStyleEditor(ImGuiStyle*) {} void ImGui::ShowStyleEditor(ImGuiStyle*) {}
bool ImGui::ShowStyleSelector(const char* label) { return false; }
void ImGui::ShowFontSelector(const char* label) {}
#endif #endif

View File

@ -1,4 +1,4 @@
// dear imgui, v1.91.6 WIP // dear imgui, v1.91.6
// (drawing and font code) // (drawing and font code)
/* /*

View File

@ -1,4 +1,4 @@
// dear imgui, v1.91.6 WIP // dear imgui, v1.91.6
// (internal structures/api) // (internal structures/api)
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility. // You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
@ -789,11 +789,9 @@ struct IMGUI_API ImDrawListSharedData
float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc float CircleSegmentMaxError; // Number of circle segments to use per pixel of radius for AddCircle() etc
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen() ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards) ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
ImVector<ImVec2> TempBuffer; // Temporary write buffer
// [Internal] Temp write buffer // Lookup tables
ImVector<ImVec2> TempBuffer;
// [Internal] Lookup tables
ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE]; // Sample points on the quarter of the circle. ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE]; // Sample points on the quarter of the circle.
float ArcFastRadiusCutoff; // Cutoff radius after which arc drawing will fallback to slower PathArcTo() float ArcFastRadiusCutoff; // Cutoff radius after which arc drawing will fallback to slower PathArcTo()
ImU8 CircleSegmentCounts[64]; // Precomputed segment count for given radius before we calculate it dynamically (to avoid calculation overhead) ImU8 CircleSegmentCounts[64]; // Precomputed segment count for given radius before we calculate it dynamically (to avoid calculation overhead)
@ -3694,7 +3692,7 @@ namespace ImGui
IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0); IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0);
IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0); IMGUI_API bool ButtonEx(const char* label, const ImVec2& size_arg = ImVec2(0, 0), ImGuiButtonFlags flags = 0);
IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0); IMGUI_API bool ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size_arg, ImGuiButtonFlags flags = 0);
IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0); IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags = 0);
IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags, float thickness = 1.0f); IMGUI_API void SeparatorEx(ImGuiSeparatorFlags flags, float thickness = 1.0f);
IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width); IMGUI_API void SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_width);
IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value); IMGUI_API bool CheckboxFlags(const char* label, ImS64* flags, ImS64 flags_value);

View File

@ -1,4 +1,4 @@
// dear imgui, v1.91.6 WIP // dear imgui, v1.91.6
// (tables and columns code) // (tables and columns code)
/* /*

View File

@ -1,4 +1,4 @@
// dear imgui, v1.91.6 WIP // dear imgui, v1.91.6
// (widgets code) // (widgets code)
/* /*
@ -1079,7 +1079,7 @@ void ImGui::Image(ImTextureID user_texture_id, const ImVec2& image_size, const I
window->DrawList->AddImage(user_texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col)); window->DrawList->AddImage(user_texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col));
} }
bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags) bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID user_texture_id, const ImVec2& image_size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col, ImGuiButtonFlags flags)
{ {
ImGuiContext& g = *GImGui; ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow(); ImGuiWindow* window = GetCurrentWindow();
@ -1101,7 +1101,7 @@ bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& imag
RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, g.Style.FrameRounding)); RenderFrame(bb.Min, bb.Max, col, true, ImClamp((float)ImMin(padding.x, padding.y), 0.0f, g.Style.FrameRounding));
if (bg_col.w > 0.0f) if (bg_col.w > 0.0f)
window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, GetColorU32(bg_col)); window->DrawList->AddRectFilled(bb.Min + padding, bb.Max - padding, GetColorU32(bg_col));
window->DrawList->AddImage(texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col)); window->DrawList->AddImage(user_texture_id, bb.Min + padding, bb.Max - padding, uv0, uv1, GetColorU32(tint_col));
return pressed; return pressed;
} }
@ -1120,7 +1120,7 @@ bool ImGui::ImageButton(const char* str_id, ImTextureID user_texture_id, const I
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
// Legacy API obsoleted in 1.89. Two differences with new ImageButton() // Legacy API obsoleted in 1.89. Two differences with new ImageButton()
// - old ImageButton() used ImTextureId as item id (created issue with multiple buttons with same image, transient texture id values, opaque computation of ID) // - old ImageButton() used ImTextureID as item id (created issue with multiple buttons with same image, transient texture id values, opaque computation of ID)
// - new ImageButton() requires an explicit 'const char* str_id' // - new ImageButton() requires an explicit 'const char* str_id'
// - old ImageButton() had frame_padding' override argument. // - old ImageButton() had frame_padding' override argument.
// - new ImageButton() always use style.FramePadding. // - new ImageButton() always use style.FramePadding.