Merge branch 'master' into docking

# Conflicts:
#	imgui.h
docking
ocornut 3 years ago
commit 9b59455184

@ -51,6 +51,20 @@ jobs:
- name: Build example_null (extra warnings, mingw 64-bit) - name: Build example_null (extra warnings, mingw 64-bit)
run: mingw32-make -C examples/example_null WITH_EXTRA_WARNINGS=1 run: mingw32-make -C examples/example_null WITH_EXTRA_WARNINGS=1
- name: Build example_null (mingw 64-bit, as DLL)
shell: bash
run: |
echo '#ifdef _EXPORT' > example_single_file.cpp
echo '# define IMGUI_API __declspec(dllexport)' >> example_single_file.cpp
echo '#else' >> example_single_file.cpp
echo '# define IMGUI_API __declspec(dllimport)' >> example_single_file.cpp
echo '#endif' >> example_single_file.cpp
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
g++ -I. -Wall -Wformat -D_EXPORT -shared -o libimgui.dll -Wl,--out-implib,libimgui.a example_single_file.cpp -limm32
g++ -I. -Wall -Wformat -o example_null.exe examples/example_null/main.cpp -L. -limgui
rm -f example_null.exe libimgui.* example_single_file.*
- name: Build example_null (extra warnings, msvc 64-bit) - name: Build example_null (extra warnings, msvc 64-bit)
shell: cmd shell: cmd
run: | run: |

@ -108,6 +108,18 @@ Docking+Viewports Branch:
- Revert removal of io.ConfigDockingWithShift config option (removed in 1.83). (#4643) - Revert removal of io.ConfigDockingWithShift config option (removed in 1.83). (#4643)
-----------------------------------------------------------------------
VERSION 1.86 WIP (In Progress)
-----------------------------------------------------------------------
Breaking Changes:
Other Changes:
- Misc: Fix MinGW DLL build issue (when IMGUI_API is defined). [@rokups]
- CI: Add MinGW DLL build to test suite. [@rokups]
----------------------------------------------------------------------- -----------------------------------------------------------------------
VERSION 1.85 (Released 2021-10-12) VERSION 1.85 (Released 2021-10-12)
----------------------------------------------------------------------- -----------------------------------------------------------------------

@ -1,4 +1,4 @@
// dear imgui, v1.85 // dear imgui, v1.86 WIP
// (main code and documentation) // (main code and documentation)
// Help: // Help:
@ -4283,9 +4283,9 @@ void ImGui::NewFrame()
for (int i = 0; i < g.TablesLastTimeActive.Size; i++) for (int i = 0; i < g.TablesLastTimeActive.Size; i++)
if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time) if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time)
TableGcCompactTransientBuffers(g.Tables.GetByIndex(i)); TableGcCompactTransientBuffers(g.Tables.GetByIndex(i));
for (int i = 0; i < g.TablesTempDataStack.Size; i++) for (int i = 0; i < g.TablesTempData.Size; i++)
if (g.TablesTempDataStack[i].LastTimeActive >= 0.0f && g.TablesTempDataStack[i].LastTimeActive < memory_compact_start_time) if (g.TablesTempData[i].LastTimeActive >= 0.0f && g.TablesTempData[i].LastTimeActive < memory_compact_start_time)
TableGcCompactTransientBuffers(&g.TablesTempDataStack[i]); TableGcCompactTransientBuffers(&g.TablesTempData[i]);
if (g.GcCompactAll) if (g.GcCompactAll)
GcCompactTransientMiscBuffers(); GcCompactTransientMiscBuffers();
g.GcCompactAll = false; g.GcCompactAll = false;
@ -4419,7 +4419,7 @@ void ImGui::Shutdown(ImGuiContext* context)
g.ShrinkWidthBuffer.clear(); g.ShrinkWidthBuffer.clear();
g.Tables.Clear(); g.Tables.Clear();
g.TablesTempDataStack.clear_destruct(); g.TablesTempData.clear_destruct();
g.DrawChannelsTempMergeBuffer.clear(); g.DrawChannelsTempMergeBuffer.clear();
g.ClipboardHandlerData.clear(); g.ClipboardHandlerData.clear();

@ -1,4 +1,4 @@
// dear imgui, v1.85 // dear imgui, v1.86 WIP
// (headers) // (headers)
// Help: // Help:
@ -64,8 +64,8 @@ Index of this file:
// Version // Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
#define IMGUI_VERSION "1.85" #define IMGUI_VERSION "1.86 WIP"
#define IMGUI_VERSION_NUM 18501 #define IMGUI_VERSION_NUM 18502
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
#define IMGUI_HAS_TABLE #define IMGUI_HAS_TABLE
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch #define IMGUI_HAS_VIEWPORT // Viewport WIP branch

@ -1,4 +1,4 @@
// dear imgui, v1.85 // dear imgui, v1.86 WIP
// (demo code) // (demo code)
// Help: // Help:

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

@ -1,4 +1,4 @@
// dear imgui, v1.85 // dear imgui, v1.86 WIP
// (internal structures/api) // (internal structures/api)
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
@ -1813,9 +1813,9 @@ struct ImGuiContext
// Table // Table
ImGuiTable* CurrentTable; ImGuiTable* CurrentTable;
int CurrentTableStackIdx; int TablesTempDataStacked; // Temporary table data size (because we leave previous instances undestructed, we generally don't use TablesTempData.Size)
ImPool<ImGuiTable> Tables; ImVector<ImGuiTableTempData> TablesTempData; // Temporary table data (buffers reused/shared across instances, support nesting)
ImVector<ImGuiTableTempData> TablesTempDataStack; ImPool<ImGuiTable> Tables; // Persistent table data
ImVector<float> TablesLastTimeActive; // Last used timestamp of each tables (SOA, for efficient GC) ImVector<float> TablesLastTimeActive; // Last used timestamp of each tables (SOA, for efficient GC)
ImVector<ImDrawChannel> DrawChannelsTempMergeBuffer; ImVector<ImDrawChannel> DrawChannelsTempMergeBuffer;
@ -2012,7 +2012,7 @@ struct ImGuiContext
memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal)); memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
CurrentTable = NULL; CurrentTable = NULL;
CurrentTableStackIdx = -1; TablesTempDataStacked = 0;
CurrentTabBar = NULL; CurrentTabBar = NULL;
TempInputId = 0; TempInputId = 0;
@ -2418,7 +2418,7 @@ struct ImGuiTableCellData
}; };
// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData // FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
struct ImGuiTable struct IMGUI_API ImGuiTable
{ {
ImGuiID ID; ImGuiID ID;
ImGuiTableFlags Flags; ImGuiTableFlags Flags;
@ -2524,14 +2524,14 @@ struct ImGuiTable
bool MemoryCompacted; bool MemoryCompacted;
bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
IMGUI_API ImGuiTable() { memset(this, 0, sizeof(*this)); LastFrameActive = -1; } ImGuiTable() { memset(this, 0, sizeof(*this)); LastFrameActive = -1; }
IMGUI_API ~ImGuiTable() { IM_FREE(RawData); } ~ImGuiTable() { IM_FREE(RawData); }
}; };
// Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table). // Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).
// - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure. // - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
// - We also leave out of this structure data that tend to be particularly useful for debugging/metrics. // - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
struct ImGuiTableTempData struct IMGUI_API ImGuiTableTempData
{ {
int TableIndex; // Index in g.Tables.Buf[] pool int TableIndex; // Index in g.Tables.Buf[] pool
float LastTimeActive; // Last timestamp this structure was used float LastTimeActive; // Last timestamp this structure was used
@ -2548,7 +2548,7 @@ struct ImGuiTableTempData
float HostBackupItemWidth; // Backup of OuterWindow->DC.ItemWidth at the end of BeginTable() float HostBackupItemWidth; // Backup of OuterWindow->DC.ItemWidth at the end of BeginTable()
int HostBackupItemWidthStackSize;//Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable() int HostBackupItemWidthStackSize;//Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable()
IMGUI_API ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; } ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; }
}; };
// sizeof() ~ 12 // sizeof() ~ 12

@ -1,4 +1,4 @@
// dear imgui, v1.85 // dear imgui, v1.86 WIP
// (tables and columns code) // (tables and columns code)
/* /*
@ -340,10 +340,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
// Acquire temporary buffers // Acquire temporary buffers
const int table_idx = g.Tables.GetIndex(table); const int table_idx = g.Tables.GetIndex(table);
g.CurrentTableStackIdx++; if (++g.TablesTempDataStacked > g.TablesTempData.Size)
if (g.CurrentTableStackIdx + 1 > g.TablesTempDataStack.Size) g.TablesTempData.resize(g.TablesTempDataStacked, ImGuiTableTempData());
g.TablesTempDataStack.resize(g.CurrentTableStackIdx + 1, ImGuiTableTempData()); ImGuiTableTempData* temp_data = table->TempData = &g.TablesTempData[g.TablesTempDataStacked - 1];
ImGuiTableTempData* temp_data = table->TempData = &g.TablesTempDataStack[g.CurrentTableStackIdx];
temp_data->TableIndex = table_idx; temp_data->TableIndex = table_idx;
table->DrawSplitter = &table->TempData->DrawSplitter; table->DrawSplitter = &table->TempData->DrawSplitter;
table->DrawSplitter->Clear(); table->DrawSplitter->Clear();
@ -1382,9 +1381,8 @@ void ImGui::EndTable()
// Clear or restore current table, if any // Clear or restore current table, if any
IM_ASSERT(g.CurrentWindow == outer_window && g.CurrentTable == table); IM_ASSERT(g.CurrentWindow == outer_window && g.CurrentTable == table);
IM_ASSERT(g.CurrentTableStackIdx >= 0); IM_ASSERT(g.TablesTempDataStacked > 0);
g.CurrentTableStackIdx--; temp_data = (--g.TablesTempDataStacked > 0) ? &g.TablesTempData[g.TablesTempDataStacked - 1] : NULL;
temp_data = g.CurrentTableStackIdx >= 0 ? &g.TablesTempDataStack[g.CurrentTableStackIdx] : NULL;
g.CurrentTable = temp_data ? g.Tables.GetByIndex(temp_data->TableIndex) : NULL; g.CurrentTable = temp_data ? g.Tables.GetByIndex(temp_data->TableIndex) : NULL;
if (g.CurrentTable) if (g.CurrentTable)
{ {

@ -1,4 +1,4 @@
// dear imgui, v1.85 // dear imgui, v1.86 WIP
// (widgets code) // (widgets code)
/* /*

Loading…
Cancel
Save