|
@@ -11,8 +11,8 @@
|
|
|
// Developed by Omar Cornut and every direct or indirect contributors to the GitHub.
|
|
// Developed by Omar Cornut and every direct or indirect contributors to the GitHub.
|
|
|
// See LICENSE.txt for copyright and licensing details (standard MIT License).
|
|
// See LICENSE.txt for copyright and licensing details (standard MIT License).
|
|
|
// This library is free but I need your support to sustain development and maintenance.
|
|
// This library is free but I need your support to sustain development and maintenance.
|
|
|
-// Businesses: you can support continued maintenance and development via support contracts or sponsoring, see docs/README.
|
|
|
|
|
-// Individuals: you can support continued maintenance and development via donations or Patreon https://www.patreon.com/imgui.
|
|
|
|
|
|
|
+// Businesses: you can support continued development via invoiced technical support, maintenance and sponsoring contracts. Please reach out to "contact AT dearimgui.org".
|
|
|
|
|
+// Individuals: you can support continued development via donations. See docs/README or web page.
|
|
|
|
|
|
|
|
// It is recommended that you don't modify imgui.cpp! It will become difficult for you to update the library.
|
|
// It is recommended that you don't modify imgui.cpp! It will become difficult for you to update the library.
|
|
|
// Note that 'ImGui::' being a namespace, you can add functions into the namespace from your own source files, without
|
|
// Note that 'ImGui::' being a namespace, you can add functions into the namespace from your own source files, without
|
|
@@ -495,7 +495,7 @@ CODE
|
|
|
- 2016/07/30 (1.50) - SameLine(x) with x>0.0f is now relative to left of column/group if any, and not always to left of window. This was sort of always the intent and hopefully breakage should be minimal.
|
|
- 2016/07/30 (1.50) - SameLine(x) with x>0.0f is now relative to left of column/group if any, and not always to left of window. This was sort of always the intent and hopefully breakage should be minimal.
|
|
|
- 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore.
|
|
- 2016/05/12 (1.49) - title bar (using ImGuiCol_TitleBg/ImGuiCol_TitleBgActive colors) isn't rendered over a window background (ImGuiCol_WindowBg color) anymore.
|
|
|
If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you, otherwise if <1.0f you need tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar.
|
|
If your TitleBg/TitleBgActive alpha was 1.0f or you are using the default theme it will not affect you, otherwise if <1.0f you need tweak your custom theme to readjust for the fact that we don't draw a WindowBg background behind the title bar.
|
|
|
- This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color:
|
|
|
|
|
|
|
+ This helper function will convert an old TitleBg/TitleBgActive color into a new one with the same visual output, given the OLD color and the OLD WindowBg color:
|
|
|
ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col) { float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a; return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a); }
|
|
ImVec4 ConvertTitleBgCol(const ImVec4& win_bg_col, const ImVec4& title_bg_col) { float new_a = 1.0f - ((1.0f - win_bg_col.w) * (1.0f - title_bg_col.w)), k = title_bg_col.w / new_a; return ImVec4((win_bg_col.x * win_bg_col.w + title_bg_col.x) * k, (win_bg_col.y * win_bg_col.w + title_bg_col.y) * k, (win_bg_col.z * win_bg_col.w + title_bg_col.z) * k, new_a); }
|
|
|
If this is confusing, pick the RGB value from title bar from an old screenshot and apply this as TitleBg/TitleBgActive. Or you may just create TitleBgActive from a tweaked TitleBg color.
|
|
If this is confusing, pick the RGB value from title bar from an old screenshot and apply this as TitleBg/TitleBgActive. Or you may just create TitleBgActive from a tweaked TitleBg color.
|
|
|
- 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInternalState() functions. Now using CreateContext(), DestroyContext(), GetCurrentContext(), SetCurrentContext().
|
|
- 2016/05/07 (1.49) - removed confusing set of GetInternalState(), GetInternalStateSize(), SetInternalState() functions. Now using CreateContext(), DestroyContext(), GetCurrentContext(), SetCurrentContext().
|
|
@@ -775,11 +775,13 @@ CODE
|
|
|
==============
|
|
==============
|
|
|
|
|
|
|
|
Q: How can I help?
|
|
Q: How can I help?
|
|
|
- A: - If you are experienced with Dear ImGui and C++, look at the github issues, look at the Wiki, read docs/TODO.txt
|
|
|
|
|
|
|
+ A: - Businesses: please reach out to "contact AT dearimgui.org" if you work in a place using Dear ImGui!
|
|
|
|
|
+ We can discuss ways for your company to fund development via invoiced technical support, maintenance or sponsoring contacts.
|
|
|
|
|
+ This is among the most useful thing you can do for Dear ImGui. With increased funding we can hire more people working on this project.
|
|
|
|
|
+ - Individuals: you can support continued development via PayPal donations. See README.
|
|
|
|
|
+ - If you are experienced with Dear ImGui and C++, look at the github issues, look at the Wiki, read docs/TODO.txt
|
|
|
and see how you want to help and can help!
|
|
and see how you want to help and can help!
|
|
|
- - Businesses: convince your company to fund development via support contracts/sponsoring! This is among the most useful thing you can do for dear imgui.
|
|
|
|
|
- - Individuals: you can also become a Patron (http://www.patreon.com/imgui) or donate on PayPal! See README.
|
|
|
|
|
- - Disclose your usage of dear imgui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
|
|
|
|
|
|
|
+ - Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
|
|
|
You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/2847). Visuals are ideal as they inspire other programmers.
|
|
You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/2847). Visuals are ideal as they inspire other programmers.
|
|
|
But even without visuals, disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions.
|
|
But even without visuals, disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions.
|
|
|
- If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues (on github or privately).
|
|
- If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues (on github or privately).
|
|
@@ -882,8 +884,6 @@ static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y);
|
|
|
|
|
|
|
|
namespace ImGui
|
|
namespace ImGui
|
|
|
{
|
|
{
|
|
|
-static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags);
|
|
|
|
|
-
|
|
|
|
|
// Navigation
|
|
// Navigation
|
|
|
static void NavUpdate();
|
|
static void NavUpdate();
|
|
|
static void NavUpdateWindowing();
|
|
static void NavUpdateWindowing();
|
|
@@ -1356,8 +1356,8 @@ const char* ImStrSkipBlank(const char* str)
|
|
|
#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
|
#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
|
|
|
|
|
|
|
// We support stb_sprintf which is much faster (see: https://github.com/nothings/stb/blob/master/stb_sprintf.h)
|
|
// We support stb_sprintf which is much faster (see: https://github.com/nothings/stb/blob/master/stb_sprintf.h)
|
|
|
-// You may set IMGUI_USE_STB_SPRINTF to use our default wrapper, or set IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
|
|
|
|
-// and setup the wrapper yourself. (FIXME-OPT: Some of our high-level operations such as ImGuiTextBuffer::appendfv() are
|
|
|
|
|
|
|
+// You may set IMGUI_USE_STB_SPRINTF to use our default wrapper, or set IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
|
|
|
|
+// and setup the wrapper yourself. (FIXME-OPT: Some of our high-level operations such as ImGuiTextBuffer::appendfv() are
|
|
|
// designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.)
|
|
// designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.)
|
|
|
//#define IMGUI_USE_STB_SPRINTF
|
|
//#define IMGUI_USE_STB_SPRINTF
|
|
|
#ifdef IMGUI_USE_STB_SPRINTF
|
|
#ifdef IMGUI_USE_STB_SPRINTF
|
|
@@ -1482,7 +1482,7 @@ ImU32 ImHashStr(const char* data_p, size_t data_size, ImU32 seed)
|
|
|
ImFileHandle ImFileOpen(const char* filename, const char* mode)
|
|
ImFileHandle ImFileOpen(const char* filename, const char* mode)
|
|
|
{
|
|
{
|
|
|
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__)
|
|
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) && !defined(__CYGWIN__) && !defined(__GNUC__)
|
|
|
- // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames.
|
|
|
|
|
|
|
+ // We need a fopen() wrapper because MSVC/Windows fopen doesn't handle UTF-8 filenames.
|
|
|
const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1;
|
|
const int filename_wsize = ImTextCountCharsFromUtf8(filename, NULL) + 1;
|
|
|
const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1;
|
|
const int mode_wsize = ImTextCountCharsFromUtf8(mode, NULL) + 1;
|
|
|
ImVector<ImWchar> buf;
|
|
ImVector<ImWchar> buf;
|
|
@@ -3877,9 +3877,8 @@ void ImGui::Initialize(ImGuiContext* context)
|
|
|
ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll;
|
|
ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll;
|
|
|
g.SettingsHandlers.push_back(ini_handler);
|
|
g.SettingsHandlers.push_back(ini_handler);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-#if 0 // FIXME-WIP: This is a placeholder to facilitate merging of Tables branch into multiple branches.
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef IMGUI_HAS_TABLE
|
|
|
// Add .ini handle for ImGuiTable type
|
|
// Add .ini handle for ImGuiTable type
|
|
|
{
|
|
{
|
|
|
ImGuiSettingsHandler ini_handler;
|
|
ImGuiSettingsHandler ini_handler;
|
|
@@ -3890,8 +3889,10 @@ void ImGui::Initialize(ImGuiContext* context)
|
|
|
ini_handler.WriteAllFn = TableSettingsHandler_WriteAll;
|
|
ini_handler.WriteAllFn = TableSettingsHandler_WriteAll;
|
|
|
g.SettingsHandlers.push_back(ini_handler);
|
|
g.SettingsHandlers.push_back(ini_handler);
|
|
|
}
|
|
}
|
|
|
|
|
+#endif // #ifdef IMGUI_HAS_TABLE
|
|
|
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+#ifdef IMGUI_HAS_DOCK
|
|
|
|
|
+#endif // #ifdef IMGUI_HAS_DOCK
|
|
|
|
|
|
|
|
g.Initialized = true;
|
|
g.Initialized = true;
|
|
|
}
|
|
}
|
|
@@ -4656,7 +4657,7 @@ static ImRect GetViewportRect()
|
|
|
return ImRect(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
|
|
return ImRect(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags)
|
|
|
|
|
|
|
+bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags)
|
|
|
{
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImGuiWindow* parent_window = g.CurrentWindow;
|
|
ImGuiWindow* parent_window = g.CurrentWindow;
|
|
@@ -9993,7 +9994,11 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size))
|
|
if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size))
|
|
|
return;
|
|
return;
|
|
|
for (int i = 0; i < windows.Size; i++)
|
|
for (int i = 0; i < windows.Size; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ ImGui::PushID(windows[i]);
|
|
|
Funcs::NodeWindow(windows[i], "Window");
|
|
Funcs::NodeWindow(windows[i], "Window");
|
|
|
|
|
+ ImGui::PopID();
|
|
|
|
|
+ }
|
|
|
ImGui::TreePop();
|
|
ImGui::TreePop();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -10004,7 +10009,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
ImGui::BulletText("%s: NULL", label);
|
|
ImGui::BulletText("%s: NULL", label);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- bool open = ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, (window->Active || window->WasActive), window);
|
|
|
|
|
|
|
+ bool open = ImGui::TreeNode(label, "%s '%s', %d @ 0x%p", label, window->Name, (window->Active || window->WasActive), window);
|
|
|
if (ImGui::IsItemHovered() && window->WasActive)
|
|
if (ImGui::IsItemHovered() && window->WasActive)
|
|
|
ImGui::GetForegroundDrawList()->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255));
|
|
ImGui::GetForegroundDrawList()->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255));
|
|
|
if (!open)
|
|
if (!open)
|
|
@@ -10104,21 +10109,23 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
IM_UNUSED(trt_rects_names);
|
|
IM_UNUSED(trt_rects_names);
|
|
|
IM_UNUSED(show_tables_rects);
|
|
IM_UNUSED(show_tables_rects);
|
|
|
IM_UNUSED(show_tables_rect_type);
|
|
IM_UNUSED(show_tables_rect_type);
|
|
|
-#if 0
|
|
|
|
|
|
|
+#ifdef IMGUI_HAS_TABLE
|
|
|
if (ImGui::TreeNode("Tables", "Tables (%d)", g.Tables.GetSize()))
|
|
if (ImGui::TreeNode("Tables", "Tables (%d)", g.Tables.GetSize()))
|
|
|
{
|
|
{
|
|
|
|
|
+ for (int n = 0; n < g.Tables.GetSize(); n++)
|
|
|
|
|
+ Funcs::NodeTable(g.Tables.GetByIndex(n));
|
|
|
ImGui::TreePop();
|
|
ImGui::TreePop();
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
|
+#endif // #define IMGUI_HAS_TABLE
|
|
|
|
|
|
|
|
// Details for Docking
|
|
// Details for Docking
|
|
|
-#if 0
|
|
|
|
|
|
|
+#ifdef IMGUI_HAS_DOCK
|
|
|
if (ImGui::TreeNode("Docking"))
|
|
if (ImGui::TreeNode("Docking"))
|
|
|
{
|
|
{
|
|
|
ImGui::TreePop();
|
|
ImGui::TreePop();
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
|
|
+#endif // #define IMGUI_HAS_DOCK
|
|
|
|
|
+
|
|
|
// Misc Details
|
|
// Misc Details
|
|
|
if (ImGui::TreeNode("Internal state"))
|
|
if (ImGui::TreeNode("Internal state"))
|
|
|
{
|
|
{
|
|
@@ -10194,8 +10201,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // FIXME-WIP: This is a placeholder to facilitate merging of Tables branch into multiple branches.
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#ifdef IMGUI_HAS_TABLE
|
|
|
// Overlay: Display Tables Rectangles
|
|
// Overlay: Display Tables Rectangles
|
|
|
if (show_tables_rects)
|
|
if (show_tables_rects)
|
|
|
{
|
|
{
|
|
@@ -10204,15 +10210,14 @@ void ImGui::ShowMetricsWindow(bool* p_open)
|
|
|
ImGuiTable* table = g.Tables.GetByIndex(table_n);
|
|
ImGuiTable* table = g.Tables.GetByIndex(table_n);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
|
+#endif // #define IMGUI_HAS_TABLE
|
|
|
|
|
|
|
|
- // FIXME-WIP: This is a placeholder to facilitate merging of Docking branch into multiple branches.
|
|
|
|
|
-#if 0
|
|
|
|
|
|
|
+#ifdef IMGUI_HAS_DOCK
|
|
|
// Overlay: Display Docking info
|
|
// Overlay: Display Docking info
|
|
|
if (show_docking_nodes && g.IO.KeyCtrl)
|
|
if (show_docking_nodes && g.IO.KeyCtrl)
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
|
+#endif // #define IMGUI_HAS_DOCK
|
|
|
|
|
|
|
|
ImGui::End();
|
|
ImGui::End();
|
|
|
}
|
|
}
|