mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-13 00:09:55 +02:00
Merged changes from original master
This commit is contained in:
21
imgui.cpp
21
imgui.cpp
@ -1,4 +1,4 @@
|
||||
// ImGui library v1.30
|
||||
// ImGui library v1.31 wip
|
||||
// See ImGui::ShowTestWindow() for sample code.
|
||||
// Read 'Programmer guide' below for notes on how to setup ImGui in your codebase.
|
||||
// Get latest version at https://github.com/ocornut/imgui
|
||||
@ -128,6 +128,7 @@
|
||||
Occasionally introducing changes that are breaking the API. The breakage are generally minor and easy to fix.
|
||||
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
|
||||
|
||||
- 2015/02/01 (1.31) - removed IO.MemReallocFn (unused)
|
||||
- 2015/01/19 (1.30) - renamed ImGuiStorage::GetIntPtr()/GetFloatPtr() to GetIntRef()/GetIntRef() because Ptr was conflicting with actual pointer storage functions.
|
||||
- 2015/01/11 (1.30) - big font/image API change! now loads TTF file. allow for multiple fonts. no need for a PNG loader.
|
||||
(1.30) - removed GetDefaultFontData(). uses io.Fonts->GetTextureData*() API to retrieve uncompressed pixels.
|
||||
@ -983,6 +984,7 @@ struct ImGuiState
|
||||
|
||||
// Render
|
||||
ImVector<ImDrawList*> RenderDrawLists;
|
||||
ImVector<ImGuiWindow*> RenderSortedWindows;
|
||||
|
||||
// Widget state
|
||||
ImGuiTextEditState InputTextState;
|
||||
@ -1768,7 +1770,7 @@ void ImGui::NewFrame()
|
||||
|
||||
// No window should be open at the beginning of the frame.
|
||||
// But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear.
|
||||
g.CurrentWindowStack.clear();
|
||||
g.CurrentWindowStack.resize(0);
|
||||
|
||||
// Create implicit window - we will only render it if the user has added something to it.
|
||||
ImGui::Begin("Debug", NULL, ImVec2(400,400));
|
||||
@ -1885,18 +1887,18 @@ void ImGui::Render()
|
||||
|
||||
// Sort the window list so that all child windows are after their parent
|
||||
// We cannot do that on FocusWindow() because childs may not exist yet
|
||||
ImVector<ImGuiWindow*> sorted_windows;
|
||||
sorted_windows.reserve(g.Windows.size());
|
||||
g.RenderSortedWindows.resize(0);
|
||||
g.RenderSortedWindows.reserve(g.Windows.size());
|
||||
for (size_t i = 0; i != g.Windows.size(); i++)
|
||||
{
|
||||
ImGuiWindow* window = g.Windows[i];
|
||||
if (window->Flags & ImGuiWindowFlags_ChildWindow) // if a child is visible its parent will add it
|
||||
if (window->Flags & ImGuiWindowFlags_ChildWindow) // if a child is visible its parent will add it
|
||||
if (window->Visible)
|
||||
continue;
|
||||
AddWindowToSortedBuffer(window, sorted_windows);
|
||||
AddWindowToSortedBuffer(window, g.RenderSortedWindows);
|
||||
}
|
||||
IM_ASSERT(g.Windows.size() == sorted_windows.size()); // We done something wrong
|
||||
g.Windows.swap(sorted_windows);
|
||||
IM_ASSERT(g.Windows.size() == g.RenderSortedWindows.size()); // We done something wrong
|
||||
g.Windows.swap(g.RenderSortedWindows);
|
||||
|
||||
// Clear data for next frame
|
||||
g.IO.MouseWheel = 0.0f;
|
||||
@ -5038,6 +5040,9 @@ static bool InputTextFilterCharacter(ImWchar c, ImGuiInputTextFlags flags)
|
||||
if (c < 128 && c != ' ' && !isprint((int)(c & 0xFF)))
|
||||
return true;
|
||||
|
||||
if (c >= 0xE000 && c <= 0xF8FF) // Filter private Unicode range. I don't imagine anybody would want to input them. GLFW on OSX seems to send private characters for special keys like arrow keys.
|
||||
return true;
|
||||
|
||||
if (flags & ImGuiInputTextFlags_CharsDecimal)
|
||||
if (!(c >= '0' && c <= '9') && (c != '.') && (c != '-') && (c != '+') && (c != '*') && (c != '/'))
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user