Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cimgui to 1.53.1 #119

Merged
merged 42 commits into from May 14, 2018
Merged

Conversation

malikolivier
Copy link
Collaborator

Update cimgui, fixing #97 and #88.

As a side note, the previous version has some compiler warning showing
up during build:

warning: third-party/cimgui/imgui/imgui.cpp: In function ‘void ImGui::RenderTriangle(ImVec2, ImGuiDir, float)’:
warning: third-party/cimgui/imgui/imgui.cpp:3136:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
warning:          r = -r; // ...fall through, no break!
warning:          ~~^~~~

The new version has no warning.

@Gekkio
Copy link
Contributor

Gekkio commented Apr 29, 2018

Thanks! 😄

I've let imgui-rs fall behind upstream a bit so this is definitely a good idea. However, cimgui 1.53 upgrades imgui to 1.53, which brings a lot of changes that we need to handle in imgui-rs as well. So, a simple version bump is unfortunately not acceptable.

@malikolivier
Copy link
Collaborator Author

malikolivier commented Apr 29, 2018

Ok. Then I will change the bits in imgui-rs that so that we can update cimgui on top of this PR.

I will review what needs to be updated by looking at imgui's changelog: https://github.com/ocornut/imgui/blob/f80314754cf64cfcafdf38558442abb750c60adf/CHANGELOG.txt#L235

@malikolivier
Copy link
Collaborator Author

malikolivier commented Apr 29, 2018

Here is the list of C++ breaking changes on 1.53.1:

C++ breaking changes:

  • Renamed the emblematic ShowTestWindow() function to ShowDemoWindow(). Kept redirection function (will obsolete).
  • Renamed GetItemsLineHeightWithSpacing() to GetFrameHeightWithSpacing() for consistency. Kept redirection function (will obsolete).
  • Renamed ImGuiTreeNodeFlags_AllowOverlapMode flag to ImGuiTreeNodeFlags_AllowItemOverlap. Kept redirection enum (will obsolete).
  • Obsoleted IsRootWindowFocused() in favor of using IsWindowFocused(ImGuiFocusedFlags_RootWindow). Kept redirection function (will obsolete). (#1382)
  • Obsoleted IsRootWindowOrAnyChildFocused() in favor of using IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows). Kept redirection function (will obsolete). (#1382)
  • Obsoleted IsRootWindowOrAnyChildHovered() in favor of using IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows). Kept redirection function (will obsolete). (#1382)
    • It seems igIsWindowHovered is broken in the current cimgui. However, the fix is already upstream. cimgui/cimgui@baebcfc
      I guess there is nothing we can do except wait for release.
    • Done in 8d3e1a8.
  • Obsoleted SetNextWindowContentWidth() in favor of using SetNextWindowContentSize()`. Kept redirection function (will obsolete).
  • Renamed ImGuiTextBuffer::append() helper to appendf(), and appendv() to appendfv() for consistency. If you copied the 'Log' demo in your code, it uses appendv() so that needs to be renamed.
  • ImDrawList: Removed 'bool anti_aliased = true' final parameter of ImDrawList::AddPolyline() and ImDrawList::AddConvexPolyFilled(). Prefer manipulating ImDrawList::Flags if you need to toggle them during the frame.
    - Done in dbc9689
  • Style, ImDrawList: Renamed style.AntiAliasedShapes to style.AntiAliasedFill for consistency and as a way to explicitly break code that manipulate those flag at runtime. You can now manipulate ImDrawList::Flags.
    - Done in d4eb0fd && 8ec33c5. I added ImDrawListFlags as it was not defined in imgui_sys.
  • Style, Begin: Removed ImGuiWindowFlags_ShowBorders window flag. Borders are now fully set up in the ImGuiStyle structure (see e.g. style.FrameBorderSize, style.WindowBorderSize, style.PopupBorderSize).
    Use ImGui::ShowStyleEditor() to look them up.
    Please note that the style system will keep evolving (hopefully stabilizing in Q1 2018), and so custom styles will probably subtly break over time.
    It is recommended that you use the StyleColorsClassic(), StyleColorsDark(), StyleColorsLight() functions. Also see ShowStyleSelector().
    - Done in 112d211 && 8ec33c5.
  • Style: Removed ImGuiCol_ComboBg in favor of combo boxes using ImGuiCol_PopupBg for consistency. Combo are normal popups.
    - Done in 5bf3eff
  • Style: Renamed ImGuiCol_ChildWindowBg to ImGuiCol_ChildBg.
    - Done in bba3e58
  • Style: Renamed style.ChildWindowRounding to style.ChildRounding, ImGuiStyleVar_ChildWindowRounding to ImGuiStyleVar_ChildRounding.
    - Done in 3b231d9
  • Removed obsolete redirection functions: SetScrollPosHere() - marked obsolete in v1.42, July 2015.
    • Unused in imgui-rs, so nothing to do (yeah!).
  • Removed obsolete redirection functions: GetWindowFont(), GetWindowFontSize() - marked obsolete in v1.48, March 2016.
    • Unused in imgui-rs, so nothing to do (yeah!).

I will first handle them. Then I will see what need to be done for non-breaking changes.

Other changes (which may break our bindings)

  • Added io.OptCursorBlink option to allow disabling cursor blinking. (#1427)
    - Done in cfd44a1
  • Added GetOverlayDrawList() helper to quickly get access to a ImDrawList that will be rendered in front of every windows.
    - Done in c016ed6
  • Added GetFrameHeight() helper which returns (FontSize + style.FramePadding.y * 2).
    • Add binding to GetFrameHeight (0c71370)
  • Drag and Drop: Added Beta API to easily use drag and drop patterns between imgui widgets.
    • Setup a source on a widget with BeginDragDropSource(), SetDragDropPayload(), EndDragDropSource() functions.
    • Receive data with BeginDragDropTarget(), AcceptDragDropPayload(), EndDragDropTarget().
    • See ImGuiDragDropFlags for various options.
    • The ColorEdit4() and ColorButton() widgets now support Drag and Drop.
    • The API is tagged as Beta as it still may be subject to small changes.
      • Done in b57d639
      • Need to add libc crate.
  • Drag and Drop: When drag and drop is active, tree nodes and collapsing header can be opened by hovering on them for 0.7 seconds.
    • Nothing to do.
  • Renamed io.OSXBehaviors to io.OptMacOSXBehaviors. Should not affect users as the compile-time default is usually enough. (Support 32 bit unicode (-DIMGUI_USE_WCHAR32). (Also, teach xtask how to wrangle submodules) #473, Some questions regarding imgui-rs #650)
  • Style: Added StyleColorsDark() style. (upgrading-imgui: Fix some typos #707) [@dougbinks]
  • Style: Added StyleColorsLight() style. Best used with frame borders + thicker font than the default font. (upgrading-imgui: Fix some typos #707)
  • Style: Added style.PopupRounding setting. (#1112)
  • Style: Added style.FrameBorderSize, style.WindowBorderSize, style.PopupBorderSize. Removed ImGuiWindowFlags_ShowBorders window flag!
    Borders are now fully set up in the ImGuiStyle structure. Use ImGui::ShowStyleEditor() to look them up. (upgrading-imgui: Fix some typos #707, fix #819, #1031)
  • Style: Various small changes to the classic style (most noticeably, buttons are now using blue shades). (upgrading-imgui: Fix some typos #707)
    • Nothing to do.
  • Style: Renamed ImGuiCol_ChildWindowBg to ImGuiCol_ChildBg.
  • Style: Renamed style.ChildWindowRounding to style.ChildRounding, ImGuiStyleVar_ChildWindowRounding to ImGuiStyleVar_ChildRounding.
  • Style: Removed ImGuiCol_ComboBg in favor of combo boxes using ImGuiCol_PopupBg for consistency. (upgrading-imgui: Fix some typos #707)
  • Style: Made the ScaleAllSizes() helper rounds down every values so they are aligned on integers.
    • Nothing to do.
  • Focus: Added SetItemDefaultFocus(), which in the current (master) branch behave the same as doing if (IsWindowAppearing()) SetScrollHere().
    In the navigation branch this will also set the default focus. Prefer using this when creating combo boxes with BeginCombo() so your code will be forward-compatible with gamepad/keyboard navigation features. (#787)
    - Done in 20d40f0
  • Combo: Popup grows horizontally to accomodate for contents that is larger then the parent combo button.
    • Nothing to do.
  • Combo: Added BeginCombo()/EndCombo() API which allows use to submit content of any form and manage your selection state without relying on indices.
    • Nothing to do.
  • Combo: Added ImGuiComboFlags_PopupAlignLeft flag to BeginCombo() to prioritize keeping the popup on the left side (for small-button-looking combos).
    - Done in db5059d
  • Combo: Added ImGuiComboFlags_HeightSmall, ImGuiComboFlags_HeightLarge, ImGuiComboFlags_HeightLargest to easily provide desired popup height.
    - Done in db5059d
  • Combo: You can use SetNextWindowSizeConstraints() before BeginCombo() to specify specific popup width/height constraints.
    • Nothing to do.
  • Combo: Offset popup position by border size so that a double border isn't so visible. (upgrading-imgui: Fix some typos #707)
    • Nothing to do.
  • Combo: Recycling windows by using a stack number instead of a unique id, wasting less memory (like menus do).
    • Nothing to do.
  • InputText: Added ImGuiInputTextFlags_NoUndoRedo flag. (#1506, #1508) [@ibachar]
  • Window: Fixed auto-resize allocating too much space for scrollbar when SizeContents is bigger than maximum window size (fixes c0547d3). (#1417)
    • Nothing to do.
  • Window: Child windows with MenuBar use regular WindowPadding.y so layout look consistent as child or as a regular window.
    • Nothing to do.
  • Window: Begin(): Fixed appending into a child window with a second Begin() from a different window stack querying the wrong window for the window->Collapsed test.
    • Nothing to do.
  • Window: Calling IsItemActive(), IsItemHovered() etc. after a call to Begin() provides item data for the title bar, so you can easily test if the title bar is being hovered, etc. (#823)
    • Nothing to do.
  • Window: Made it possible to use SetNextWindowPos() on a child window.
    • Nothing to do.
  • Window: Fixed a one frame glitch. When an appearing window claimed the focus themselves, the title bar wouldn't use the focused color for one frame.
    • Nothing to do.
  • Window: Added ImGuiWindowFlags_ResizeFromAnySide flag to resize from any borders or from the lower-left corner of a window. This requires your backend to honor GetMouseCursor() requests for full usability. (#822)
    - Done in 2103da1
  • Window: Sizing fixes when useing SetNextWindowSize() on individual axises.
    • Nothing to do.
  • Window: Hide new window for one frame until they calculate their size. Also fixes SetNextWindowPos() given a non-zero pivot. (#1694)
    • Nothing to do.
  • Window: Made mouse wheel scrolling accommodate better to windows that are smaller than the scroll step.
    • Nothing to do.
  • Window: SetNextWindowContentSize() adjust for the size of decorations (title bar/menu bar), but not for borders are we consistently make borders not affect layout.
    If you need a non-child window of an exact size with border enabled but zero window padding, you'll need to accodomate for the border size yourself.
    • Nothing to do.
  • Window: Using the ImGuiWindowFlags_NoScrollWithMouse flag on a child window forwards the mouse wheel event to the parent window, unless either ImGuiWindowFlags_NoInputs or ImGuiWindowFlags_NoScrollbar are also set. (#1380, #1502)
    • Nothing to do.
  • Window: Active Modal window always set the WantCaptureKeyboard flag. (Require correct version of cc #744)
    • Nothing to do.
  • Window: Moving window doesn't use accumulating MouseDelta so straying out of imgui boundaries keeps moved imgui window at the same cursor-relative position.
    • Nothing to do.
  • Window: BeginChild() which an explicit name doesn't include the hash within the internal window name. (#1698)
    • Nothing to do.
  • IsWindowFocused(): Added ImGuiFocusedFlags_ChildWindows flag to include child windows in the focused test. (#1382).
  • IsWindowFocused(): Added ImGuiFocusedFlags_RootWindow flag to start focused test from the root (top-most) window. Obsolete IsRootWindowFocused(). (#1382)
  • IsWindowHovered(): Added ImGuiHoveredFlags_ChildWindows flag to include child windows in the hovered test. (#1382).
  • IsWindowHovered(): Added ImGuiHoveredFlags_RootWindow flag to start hovered test from the root (top-most) window. The combination of both flags obsoletes IsRootWindowOrAnyChildHovered(). (#1382)
  • IsWindowHovered(): Fixed return value when an item is active to use the same logic as IsItemHovered(). (#1382, #1404)
    - Nothing to do.
  • IsWindowHovered(): Always return true when current window is being moved. (#1382)
    - Nothing to do.
  • Scrollbar: Fixed issues with vertical scrollbar flickering/appearing, typically when manually resizing and using a pattern of filling available height (e.g. full sized BeginChild).
    - Nothing to do.
  • Scrollbar: Minor graphical fix for when scrollbar don't have enough visible space to display the full grab.
    - Nothing to do.
  • Scrolling: Fixed padding and scrolling asymetry where lower/right sides of a window wouldn't use WindowPadding properly + causing minor scrolling glitches.
    - Nothing to do.
  • Tree: TreePush with zero arguments was ambiguous. Resolved by making it call TreePush(const void*). [@jasonwilkins]
    - Nothing to do.
  • Tree: Renamed ImGuiTreeNodeFlags_AllowOverlapMode to ImGuiTreeNodeFlags_AllowItemOverlap. (Upgrade Dear ImGui 1.84.2 -> 1.86 #600, #1330)
    - Done in a5ed022
  • MenuBar: Fixed minor rendering issues on the right size when resizing a window very small and using rounded window corners.
    - Nothing to do.
  • MenuBar: better software clipping to handle small windows, in particular child window don't have minimum constraints so we need to render clipped menus better.
    - Nothing to do.
  • BeginMenu(): Tweaked the Arrow/Triangle displayed on child menu items.
    - Nothing to do.
  • Columns: Clipping columns borders on Y axis on CPU because some Linux GPU drivers appears to be unhappy with triangle spanning large regions. (window_draw_list: Add support for drawing text #125)
    - Nothing to do.
  • Columns: Added ImGuiColumnsFlags_GrowParentContentsSize to internal API to restore old content sizes behavior (may be obsolete). (#1444, window_draw_list: Add support for drawing text #125)
    - Nothing to do.
  • Columns: Columns width is no longer lost when dragging a column to the right side of the window, until releasing the mouse button you have a chance to save them. (#1499, window_draw_list: Add support for drawing text #125). [@ggtucker]
    - Nothing to do.
  • Columns: Fixed dragging when using a same of columns multiple times in the frame. (window_draw_list: Add support for drawing text #125)
  • Indent(), Unindent(): Allow passing negative values.
    - Nothing to do.
  • ColorEdit4(): Made IsItemActive() return true when picker popup is active. (#1489)
    - Nothing to do.
  • ColorEdit4(): Tweaked tooltip so that the color button aligns more correctly with text.
    - Nothing to do.
  • ColorEdit4(): Support drag and drop. Color buttons can be used as drag sources, and ColorEdit widgets as drag targets. ([examples] support: Fix scale bug #143)
    - Nothing to do.
  • ColorPicker4(): Fixed continously returning true when holding mouse button on the sat/value/alpha locations. We only return true on value change. (#1489)
    - Nothing to do.
  • NewFrame(): using literal strings in the most-frequently firing IM_ASSERT expressions to increase the odd of programmers seeing them (especially those who don't use a debugger).
    - Nothing to do.
  • NewFrame() now asserts if neither Render or EndFrame have been called. Exposed EndFrame(). Made it legal to call EndFrame() more than one. (#1423)
    - Done in cd37cf9.
  • ImGuiStorage: Added BuildSortByKey() helper to rebuild storage from stratch.
    - Ignore for now. Not included in cimgui.h.
  • ImFont: Added GetDebugName() helper.
    - Done in e4668f0
  • ImFontAtlas: Added missing Thai punctuation in the GetGlyphRangesThai() ranges. (#1396) [@nProtect]
    - Nothing to do.
  • ImDrawList: Removed 'bool anti_aliased = true' final parameter of ImDrawList::AddPolyline() and ImDrawList::AddConvexPolyFilled(). Anti-aliasing is controlled via the regular style.AntiAliased flags.
    - Nothing to do.
  • ImDrawList: Added ImDrawList::AddImageRounded() helper. (#845) [@thedmd]
    - Done in e64a1cf
  • ImDrawList: Refactored to make ImDrawList independant of ImGui. Removed static variable in PathArcToFast() which caused linking issues to some.
    - Nothing to do.
  • ImDrawList: Exposed ImDrawCornerFlags, replaced occurences of ~0 with an explicit ImDrawCornerFlags_All. NB: Inversed BotLeft (prev 1<<3, now 1<<2) and BotRight (prev 1<<2, now 1<<3).
    - Done in d0543bb
  • ImVector: Added ImVector::push_front() helper.
    - Ignore for now. Not included in cimgui.h.
  • ImVector: Added ImVector::contains() helper.
    - Ignore for now. Not included in cimgui.h.
  • ImVector: insert() uses grow_capacity() instead of using grow policy inconsistent with push_back().
    - Nothing to do.
  • Internals: Remove requirement to define IMGUI_DEFINE_PLACEMENT_NEW to use the IM_PLACEMENT_NEW macro. (#1103)
    - Nothing to do.
  • Internals: ButtonBehavior: Fixed ImGuiButtonFlags_NoHoldingActiveID flag from incorrectly setting the ActiveIdClickOffset field.
    This had no known effect within imgui code but could have affected custom drag and drop patterns. And it is more correct this way! (#1418)
    - Nothing to do.
  • Internals: ButtonBehavior: Fixed ImGuiButtonFlags_AllowOverlapMode to avoid temporarily activating widgets on click before they have been correctly double-hovered. (Add support for winit 0.22 #319, Upgrade Dear ImGui 1.84.2 -> 1.86 #600)
    - Nothing to do.
  • Internals: Added SplitterBehavior() helper. (Add support for winit 0.22 #319)
    - Nothing to do.
  • Internals: Added IM_NEW(), IM_DELETE() helpers. (Condense/simplify list_box API? #484, Fix examples DPI scaling when scaling is non-integer #504, #1517)
    - Nothing to do.
  • Internals: Basic refactor of the settings API which now allows external elements to be loaded/saved.
    - Nothing to do.
  • Demo: Added ShowFontSelector() showing loaded fonts.
    - Done in 4eef43f
  • Demo: Added ShowStyleSelector() to select among default styles. (upgrading-imgui: Fix some typos #707)
    - Done in 4eef43f
  • Demo: Renamed the emblematic ShowTestWindow() function to ShowDemoWindow().
    - Done in cf15d49
  • Demo: Style Editor: Added a "Simplified settings" sections with checkboxes for border size and frame rounding. (upgrading-imgui: Fix some typos #707, #1019)
    - Nothing to do
  • Demo: Style Editor: Added combo box to select stock styles and select current font when multiple are loaded. (upgrading-imgui: Fix some typos #707)
    - Nothing to do
  • Demo: Style Editor: Using local storage so Save/Revert button makes more sense without code passing its storage. Aadded horizontal scroll bar. Fixed Save/Revert button to be always accessible. (#1211)
    - Nothing to do
  • Demo: Console: Fixed context menu issue. (#1404)
    - Nothing to do
  • Demo: Console: Fixed incorrect positioning which was hidden by a minor scroll issue (this would affect people who copied the Console code as is).
    - Nothing to do
  • Demo: Constrained Resize: Added more test cases. (#1417)
    - Nothing to do
  • Demo: Custom Rendering: Fixed clipping rectangle extruding out of parent window.
    - Nothing to do
  • Demo: Layout: Removed unnecessary and misleading BeginChild/EndChild calls.
    - Nothing to do
  • Demo: The "Color Picker with Palette" demo supports drag and drop. ([examples] support: Fix scale bug #143)
    - Nothing to do
  • Demo: Display better mouse cursor info for debugging backends.
    - Nothing to do
  • Demo: Stopped using rand() function in demo code.
    - Nothing to do
  • Examples: Added a handful of extra comments (about fonts, third-party libraries used in the examples, etc.).
    - Nothing to do
  • Examples: DirectX9: Handle loss of D3D9 device (D3DERR_DEVICELOST). (#1464)
    - Nothing to do
  • Examples: Added null_example/ which is helpful for quick testing on multiple compilers/settings without relying on graphics library.
    - Nothing to do
  • Fix for using alloca() in "Clang with Microsoft Codechain" mode.
    - Nothing to do
  • Various fixes, optimizations, comments.
    - Nothing to do

Other

  • Allow to set some new flags on inputs: abd3959
  • Add "No close" window option to demo: 49ab5c5
  • Add binding to ImFontConfig_DefaultConstructor: 9cd0e61

@Gekkio
Copy link
Contributor

Gekkio commented Apr 29, 2018

👍

Note that you'll also need to look at all other changes too, because "breaking changes" only lists things that would break C++ code. For example, the first change in the "Other Changes" section changes the layout of the ImGuiIO struct, which is a breaking change from our point of view.

It's a lot of work, which is why I've been lazy and haven't done it in a while. 😝

@malikolivier
Copy link
Collaborator Author

Yeah, thanks for the tip. Even if it takes one or two weeks, I will do that step by step. We cannot afford to stay behind upstream too long :)

@Gekkio
Copy link
Contributor

Gekkio commented Apr 29, 2018

Also, if things are renamed, always try to provide deprecated redirection functions if possible.

This commit has some examples: 6a36384

@malikolivier malikolivier force-pushed the update-cimgui-to-1.53.1 branch 2 times, most recently from c310270 to ad7177f Compare April 29, 2018 09:25
Update cimgui, fixing imgui-rs#97 and imgui-rs#88.

As a side note, the previous version has some compiler warning showing
up during build:

warning: third-party/cimgui/imgui/imgui.cpp: In function ‘void ImGui::RenderTriangle(ImVec2, ImGuiDir, float)’:
warning: third-party/cimgui/imgui/imgui.cpp:3136:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
warning:          r = -r; // ...fall through, no break!
warning:          ~~^~~~

The new version has no warning.
This commit adds the `ImGuiFocusedFlags' input flag that was missing.
Should use `sys::igIsWindowFocused(ImGuiFocusedFlags_RootWindow)`
instead.
Should use `igIsWindowFocused(ImGuiFocusedFlags::RootAndChildWindows)`
instead.
Update struct for ImGuiHoveredFlags.

NB: igIsWindowHovered, and thus igIsRootWindowOrAnyChildHovered, are
broken now because of a bug.
The fix is commited upstream, but not released yet.
cimgui/cimgui@baebcfc

I guess nothing can be done but wait for the next cimgui release.
There is a small change of behaviour: previous height value is not
preserved when igSetNextWindowContentWidth is used. There is no way
around it unless we mess with imgui's internals.

Official Dear ImGui chose this easy solution as well:

    static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); }

https://github.com/ocornut/imgui/blob/429f48bb4fa7fdffdb996e4a697d6df48babe3eb/imgui.h#L1132
This commit does not include deprecation warning.
Indeed, defining a `ImGuiTextBuffer_append` function with a deprecation
warning would require to write a variadic function in rust. However,
this is impossible, and the FFI rust doc says so:
https://doc.rust-lang.org/book/first-edition/ffi.html#variadic-functions

Dear ImGui did not deprecate `append()`, they simply renamed it too.
There is no way I know of to make a deprecation warning in such a case.
Code that uses ImDrawList_AddPolyline or ImDrawList_AddConvexPolyFilled will
break.
Add deprecation warning for each renamed variant.

However, it will just fail to compile if the deprecated variant is used
inside a match statement. It is not possible to make aliases of variants
in Rust.
Here is the original commit in Dear ImGui implementating the "No close"
button:

ocornut/imgui@20ba79aa5
@malikolivier
Copy link
Collaborator Author

malikolivier commented Apr 30, 2018

ctest does not like macro, so in particular it does not support bitflags (for the time being) 😞 https://github.com/alexcrichton/ctest/issues/23

@malikolivier
Copy link
Collaborator Author

The diff of cimgui.h between 1.52 amd 1.53.1 was quite noisy. There were some style changes.

So I put both version of the code into a style formatter and got a clean diff. So we can be sure to add all the new stuff. See below:

diff --git a/cimgui/cimgui-1.52.h b/cimgui/cimgui-1.53.1.h
similarity index 85%
rename from cimgui/cimgui-1.52.h
rename to cimgui/cimgui-1.53.1.h
index f101d7f..54d4a30 100644
--- a/cimgui/cimgui-1.52.h
+++ b/cimgui/cimgui-1.53.1.h
@@ -40,6 +40,7 @@ struct ImFontAtlas;
 struct ImDrawCmd;
 struct ImGuiListClipper;
 struct ImGuiTextFilter;
+struct ImGuiPayload;
 
 #if defined __cplusplus
 #define IMFONTGLYPH ImFontGlyph
@@ -65,6 +66,11 @@ typedef int ImGuiInputTextFlags;
 typedef int ImGuiSelectableFlags;
 typedef int ImGuiTreeNodeFlags;
 typedef int ImGuiHoveredFlags;
+typedef int ImGuiComboFlags;
+typedef int ImGuiDragDropFlags;
+typedef int ImGuiFocusedFlags;
+typedef int ImDrawCornerFlags;
+typedef int ImDrawListFlags;
 typedef int (*ImGuiTextEditCallback)(struct ImGuiTextEditCallbackData *data);
 typedef void (*ImGuiSizeConstraintCallback)(struct ImGuiSizeConstraintCallbackData *data);
 typedef void (*ImDrawCallback)(CONST struct ImDrawList *parent_list, CONST struct ImDrawCmd *cmd);
@@ -94,7 +100,7 @@ enum
     ImGuiWindowFlags_NoScrollWithMouse = 1 << 4,
     ImGuiWindowFlags_NoCollapse = 1 << 5,
     ImGuiWindowFlags_AlwaysAutoResize = 1 << 6,
-    ImGuiWindowFlags_ShowBorders = 1 << 7,
+    //ImGuiWindowFlags_ShowBorders = 1 << 7,
     ImGuiWindowFlags_NoSavedSettings = 1 << 8,
     ImGuiWindowFlags_NoInputs = 1 << 9,
     ImGuiWindowFlags_MenuBar = 1 << 10,
@@ -103,7 +109,8 @@ enum
     ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13,
     ImGuiWindowFlags_AlwaysVerticalScrollbar = 1 << 14,
     ImGuiWindowFlags_AlwaysHorizontalScrollbar = 1 << 15,
-    ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16
+    ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16,
+    ImGuiWindowFlags_ResizeFromAnySide = 1 << 17,
 };
 
 enum
@@ -123,14 +130,15 @@ enum
     ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12,
     ImGuiInputTextFlags_AlwaysInsertMode = 1 << 13,
     ImGuiInputTextFlags_ReadOnly = 1 << 14,
-    ImGuiInputTextFlags_Password = 1 << 15
+    ImGuiInputTextFlags_Password = 1 << 15,
+    ImGuiInputTextFlags_NoUndoRedo = 1 << 16,
 };
 
 enum
 {
     ImGuiTreeNodeFlags_Selected = 1 << 0,
     ImGuiTreeNodeFlags_Framed = 1 << 1,
-    ImGuiTreeNodeFlags_AllowOverlapMode = 1 << 2,
+    ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2,
     ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3,
     ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4,
     ImGuiTreeNodeFlags_DefaultOpen = 1 << 5,
@@ -149,13 +157,45 @@ enum
     ImGuiSelectableFlags_AllowDoubleClick = 1 << 2
 };
 
+enum ImGuiComboFlags_
+{
+    ImGuiComboFlags_PopupAlignLeft = 1 << 0,
+    ImGuiComboFlags_HeightSmall = 1 << 1,
+    ImGuiComboFlags_HeightRegular = 1 << 2,
+    ImGuiComboFlags_HeightLarge = 1 << 3,
+    ImGuiComboFlags_HeightLargest = 1 << 4,
+    ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest
+};
+
+enum ImGuiFocusedFlags_
+{
+    ImGuiFocusedFlags_ChildWindows = 1 << 0,
+    ImGuiFocusedFlags_RootWindow = 1 << 1,
+    ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows
+};
+
 enum ImGuiHoveredFlags_
 {
-    ImGuiHoveredFlags_Default = 0,
-    ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 0,
-    ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 2,
-    ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 3,
-    ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped
+    ImGuiHoveredFlags_ChildWindows = 1 << 0,
+    ImGuiHoveredFlags_RootWindow = 1 << 1,
+    ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 2,
+    //ImGuiHoveredFlags_AllowWhenBlockedByModal     = 1 << 3,
+    ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 4,
+    ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 5,
+    ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped,
+    ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows
+};
+
+enum ImGuiDragDropFlags_
+{
+    ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0,
+    ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1,
+    ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2,
+    ImGuiDragDropFlags_SourceAllowNullID = 1 << 3,
+    ImGuiDragDropFlags_SourceExtern = 1 << 4,
+    ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10,
+    ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11,
+    ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect
 };
 
 enum
@@ -187,7 +227,7 @@ enum
     ImGuiCol_Text,
     ImGuiCol_TextDisabled,
     ImGuiCol_WindowBg,
-    ImGuiCol_ChildWindowBg,
+    ImGuiCol_ChildBg,
     ImGuiCol_PopupBg,
     ImGuiCol_Border,
     ImGuiCol_BorderShadow,
@@ -202,7 +242,6 @@ enum
     ImGuiCol_ScrollbarGrab,
     ImGuiCol_ScrollbarGrabHovered,
     ImGuiCol_ScrollbarGrabActive,
-    ImGuiCol_ComboBg,
     ImGuiCol_CheckMark,
     ImGuiCol_SliderGrab,
     ImGuiCol_SliderGrabActive,
@@ -227,6 +266,7 @@ enum
     ImGuiCol_PlotHistogramHovered,
     ImGuiCol_TextSelectedBg,
     ImGuiCol_ModalWindowDarkening,
+    ImGuiCol_DragDropTarget,
     ImGuiCol_COUNT
 };
 
@@ -235,10 +275,15 @@ enum
     ImGuiStyleVar_Alpha,
     ImGuiStyleVar_WindowPadding,
     ImGuiStyleVar_WindowRounding,
+    ImGuiStyleVar_WindowBorderSize,
     ImGuiStyleVar_WindowMinSize,
-    ImGuiStyleVar_ChildWindowRounding,
+    ImGuiStyleVar_ChildRounding,
+    ImGuiStyleVar_ChildBorderSize,
+    ImGuiStyleVar_PopupRounding,
+    ImGuiStyleVar_PopupBorderSize,
     ImGuiStyleVar_FramePadding,
     ImGuiStyleVar_FrameRounding,
+    ImGuiStyleVar_FrameBorderSize,
     ImGuiStyleVar_ItemSpacing,
     ImGuiStyleVar_ItemInnerSpacing,
     ImGuiStyleVar_IndentSpacing,
@@ -291,16 +336,40 @@ enum
     ImGuiCond_Appearing = 1 << 3
 };
 
+enum ImDrawCornerFlags_
+{
+    ImDrawCornerFlags_TopLeft = 1 << 0,
+    ImDrawCornerFlags_TopRight = 1 << 1,
+    ImDrawCornerFlags_BotLeft = 1 << 2,
+    ImDrawCornerFlags_BotRight = 1 << 3,
+    ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight,
+    ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight,
+    ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft,
+    ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight,
+    ImDrawCornerFlags_All = 0xF
+};
+
+enum ImDrawListFlags_
+{
+    ImDrawListFlags_AntiAliasedLines = 1 << 0,
+    ImDrawListFlags_AntiAliasedFill = 1 << 1
+};
+
 struct ImGuiStyle
 {
     float Alpha;
     struct ImVec2 WindowPadding;
-    struct ImVec2 WindowMinSize;
     float WindowRounding;
+    float WindowBorderSize;
+    ImVec2 WindowMinSize;
     struct ImVec2 WindowTitleAlign;
-    float ChildWindowRounding;
+    float ChildRounding;
+    float ChildBorderSize;
+    float PopupRounding;
+    float PopupBorderSize;
     struct ImVec2 FramePadding;
     float FrameRounding;
+    float FrameBorderSize;
     struct ImVec2 ItemSpacing;
     struct ImVec2 ItemInnerSpacing;
     struct ImVec2 TouchExtraPadding;
@@ -314,7 +383,7 @@ struct ImGuiStyle
     struct ImVec2 DisplayWindowPadding;
     struct ImVec2 DisplaySafeAreaPadding;
     bool AntiAliasedLines;
-    bool AntiAliasedShapes;
+    bool AntiAliasedFill;
     float CurveTessellationTol;
     struct ImVec4 Colors[ImGuiCol_COUNT];
 };
@@ -324,8 +393,8 @@ struct ImGuiIO
     struct ImVec2 DisplaySize;
     float DeltaTime;
     float IniSavingRate;
-    const char *IniFilename;
-    const char *LogFilename;
+    CONST char *IniFilename;
+    CONST char *LogFilename;
     float MouseDoubleClickTime;
     float MouseDoubleClickMaxDist;
     float MouseDragThreshold;
@@ -340,10 +409,11 @@ struct ImGuiIO
     struct ImVec2 DisplayFramebufferScale;
     struct ImVec2 DisplayVisibleMin;
     struct ImVec2 DisplayVisibleMax;
-    bool OSXBehaviors;
+    bool OptMacOSXBehaviors;
+    bool OptCursorBlink;
     void (*RenderDrawListsFn)(struct ImDrawData *data);
-    const char *(*GetClipboardTextFn)(void *user_data);
-    void (*SetClipboardTextFn)(void *user_data, const char *text);
+    CONST char *(*GetClipboardTextFn)(void *user_data);
+    void (*SetClipboardTextFn)(void *user_data, CONST char *text);
     void *ClipboardUserData;
     void *(*MemAllocFn)(size_t sz);
     void (*MemFreeFn)(void *ptr);
@@ -377,6 +447,7 @@ struct ImGuiIO
     bool MouseDownOwned[5];
     float MouseDownDuration[5];
     float MouseDownDurationPrev[5];
+    ImVec2 MouseDragMaxDistanceAbs[5];
     float MouseDragMaxDistanceSqr[5];
     float KeysDownDuration[512];
     float KeysDownDurationPrev[512];
@@ -443,8 +514,10 @@ struct ImFontConfig
     bool PixelSnapH;
     struct ImVec2 GlyphExtraSpacing;
     struct ImVec2 GlyphOffset;
-    const ImWchar *GlyphRanges;
+    CONST ImWchar *GlyphRanges;
     bool MergeMode;
+    unsigned int RasterizerFlags;
+    float RasterizerMultiply;
     char Name[32];
     struct ImFont *DstFont;
 };
@@ -455,6 +528,19 @@ struct ImGuiListClipper
     float ItemsHeight;
     int ItemsCount, StepNo, DisplayStart, DisplayEnd;
 };
+
+struct ImGuiPayload
+{
+    CONST void *Data;
+    int DataSize;
+
+    ImGuiID SourceId;
+    ImGuiID SourceParentId;
+    int DataFrameCount;
+    char DataType[8 + 1];
+    bool Preview;
+    bool Delivery;
+};
 #endif // CIMGUI_DEFINE_ENUMS_AND_STRUCTS
 
 // Main
@@ -463,12 +549,15 @@ CIMGUI_API struct ImGuiStyle *igGetStyle();
 CIMGUI_API struct ImDrawData *igGetDrawData();
 CIMGUI_API void igNewFrame();
 CIMGUI_API void igRender();
+CIMGUI_API void igEndFrame();
 CIMGUI_API void igShutdown();
 
 // Demo/Debug/Info
-CIMGUI_API void igShowTestWindow(bool *opened);
+CIMGUI_API void igShowDemoWindow(bool *opened);
 CIMGUI_API void igShowMetricsWindow(bool *opened);
 CIMGUI_API void igShowStyleEditor(struct ImGuiStyle *ref);
+CIMGUI_API void igShowStyleSelector(CONST char *label);
+CIMGUI_API void igShowFontSelector(CONST char *label);
 CIMGUI_API void igShowUserGuide();
 
 // Window
@@ -498,7 +587,6 @@ CIMGUI_API void igSetNextWindowPos(CONST struct ImVec2 pos, ImGuiCond cond, CONS
 CIMGUI_API void igSetNextWindowSize(CONST struct ImVec2 size, ImGuiCond cond);
 CIMGUI_API void igSetNextWindowSizeConstraints(CONST struct ImVec2 size_min, CONST struct ImVec2 size_max, ImGuiSizeConstraintCallback custom_callback, void *custom_callback_data);
 CIMGUI_API void igSetNextWindowContentSize(CONST struct ImVec2 size);
-CIMGUI_API void igSetNextWindowContentWidth(float width);
 CIMGUI_API void igSetNextWindowCollapsed(bool collapsed, ImGuiCond cond);
 CIMGUI_API void igSetNextWindowFocus();
 CIMGUI_API void igSetWindowPos(CONST struct ImVec2 pos, ImGuiCond cond);
@@ -518,7 +606,6 @@ CIMGUI_API void igSetScrollX(float scroll_x);
 CIMGUI_API void igSetScrollY(float scroll_y);
 CIMGUI_API void igSetScrollHere(float center_y_ratio);
 CIMGUI_API void igSetScrollFromPosY(float pos_y, float center_y_ratio);
-CIMGUI_API void igSetKeyboardFocusHere(int offset);
 CIMGUI_API void igSetStateStorage(struct ImGuiStorage *tree);
 CIMGUI_API struct ImGuiStorage *igGetStateStorage();
 
@@ -572,7 +659,8 @@ CIMGUI_API void igSetCursorScreenPos(CONST struct ImVec2 pos);
 CIMGUI_API void igAlignTextToFramePadding();
 CIMGUI_API float igGetTextLineHeight();
 CIMGUI_API float igGetTextLineHeightWithSpacing();
-CIMGUI_API float igGetItemsLineHeightWithSpacing();
+CIMGUI_API float igGetFrameHeight();
+CIMGUI_API float igGetFrameHeightWithSpacing();
 
 //Columns
 CIMGUI_API void igColumns(int count, CONST char *id, bool border);
@@ -622,15 +710,18 @@ CIMGUI_API bool igCheckbox(CONST char *label, bool *v);
 CIMGUI_API bool igCheckboxFlags(CONST char *label, unsigned int *flags, unsigned int flags_value);
 CIMGUI_API bool igRadioButtonBool(CONST char *label, bool active);
 CIMGUI_API bool igRadioButton(CONST char *label, int *v, int v_button);
-CIMGUI_API bool igCombo(CONST char *label, int *current_item, CONST char *CONST *items, int items_count, int height_in_items);
-CIMGUI_API bool igCombo2(CONST char *label, int *current_item, CONST char *items_separated_by_zeros, int height_in_items);
-CIMGUI_API bool igCombo3(CONST char *label, int *current_item, bool (*items_getter)(void *data, int idx, CONST char **out_text), void *data, int items_count, int height_in_items);
 CIMGUI_API void igPlotLines(CONST char *label, CONST float *values, int values_count, int values_offset, CONST char *overlay_text, float scale_min, float scale_max, struct ImVec2 graph_size, int stride);
 CIMGUI_API void igPlotLines2(CONST char *label, float (*values_getter)(void *data, int idx), void *data, int values_count, int values_offset, CONST char *overlay_text, float scale_min, float scale_max, struct ImVec2 graph_size);
 CIMGUI_API void igPlotHistogram(CONST char *label, CONST float *values, int values_count, int values_offset, CONST char *overlay_text, float scale_min, float scale_max, struct ImVec2 graph_size, int stride);
 CIMGUI_API void igPlotHistogram2(CONST char *label, float (*values_getter)(void *data, int idx), void *data, int values_count, int values_offset, CONST char *overlay_text, float scale_min, float scale_max, struct ImVec2 graph_size);
 CIMGUI_API void igProgressBar(float fraction, CONST struct ImVec2 *size_arg, CONST char *overlay);
 
+CIMGUI_API bool igBeginCombo(CONST char *label, CONST char *preview_value, ImGuiComboFlags flags);
+CIMGUI_API void igEndCombo();
+CIMGUI_API bool igCombo(CONST char *label, int *current_item, CONST char *CONST *items, int items_count, int popup_max_height_in_items);
+CIMGUI_API bool igCombo2(CONST char *label, int *current_item, CONST char *items_separated_by_zeros, int popup_max_height_in_items);
+CIMGUI_API bool igCombo3(CONST char *label, int *current_item, bool (*items_getter)(void *data, int idx, CONST char **out_text), void *data, int items_count, int popup_max_height_in_items);
+
 // Widgets: Drags (tip: ctrl+click on a drag box to input with keyboard. manually input values aren't clamped, can go off-bounds)
 // For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
 CIMGUI_API bool igDragFloat(CONST char *label, float *v, float v_speed, float v_min, float v_max, CONST char *display_format, float power); // If v_max >= v_max we have no bound
@@ -731,7 +822,7 @@ CIMGUI_API bool igMenuItemPtr(CONST char *label, CONST char *shortcut, bool *p_s
 
 // Popup
 CIMGUI_API void igOpenPopup(CONST char *str_id);
-CIMGUI_API bool igOpenPopupOnItemClick(const char *str_id, int mouse_button);
+CIMGUI_API bool igOpenPopupOnItemClick(CONST char *str_id, int mouse_button);
 CIMGUI_API bool igBeginPopup(CONST char *str_id);
 CIMGUI_API bool igBeginPopupModal(CONST char *name, bool *p_open, ImGuiWindowFlags extra_flags);
 CIMGUI_API bool igBeginPopupContextItem(CONST char *str_id, int mouse_button);
@@ -749,12 +840,24 @@ CIMGUI_API void igLogFinish();
 CIMGUI_API void igLogButtons();
 CIMGUI_API void igLogText(CONST char *fmt, ...);
 
+CIMGUI_API bool igBeginDragDropSource(ImGuiDragDropFlags flags, int mouse_button);
+CIMGUI_API bool igSetDragDropPayload(CONST char *type, CONST void *data, size_t size, ImGuiCond cond);
+CIMGUI_API void igEndDragDropSource();
+CIMGUI_API bool igBeginDragDropTarget();
+CIMGUI_API CONST struct ImGuiPayload *igAcceptDragDropPayload(CONST char *type, ImGuiDragDropFlags flags);
+CIMGUI_API void igEndDragDropTarget();
+
 // Clipping
 CIMGUI_API void igPushClipRect(CONST struct ImVec2 clip_rect_min, CONST struct ImVec2 clip_rect_max, bool intersect_with_current_clip_rect);
 CIMGUI_API void igPopClipRect();
 
 // Styles
 CIMGUI_API void igStyleColorsClassic(struct ImGuiStyle *dst);
+CIMGUI_API void igStyleColorsDark(struct ImGuiStyle *dst);
+CIMGUI_API void igStyleColorsLight(struct ImGuiStyle *dst);
+
+CIMGUI_API void igSetItemDefaultFocus();
+CIMGUI_API void igSetKeyboardFocusHere(int offset);
 
 // Utilities
 CIMGUI_API bool igIsItemHovered(ImGuiHoveredFlags flags);
@@ -767,16 +870,18 @@ CIMGUI_API void igGetItemRectMin(struct ImVec2 *pOut);
 CIMGUI_API void igGetItemRectMax(struct ImVec2 *pOut);
 CIMGUI_API void igGetItemRectSize(struct ImVec2 *pOut);
 CIMGUI_API void igSetItemAllowOverlap();
-CIMGUI_API bool igIsWindowFocused();
+CIMGUI_API bool igIsWindowFocused(ImGuiFocusedFlags flags);
 CIMGUI_API bool igIsWindowHovered(ImGuiHoveredFlags falgs);
-CIMGUI_API bool igIsRootWindowFocused();
-CIMGUI_API bool igIsRootWindowOrAnyChildFocused();
-CIMGUI_API bool igIsRootWindowOrAnyChildHovered(ImGuiHoveredFlags flags);
+CIMGUI_API bool igIsAnyWindowFocused();
 CIMGUI_API bool igIsAnyWindowHovered();
 CIMGUI_API bool igIsRectVisible(CONST struct ImVec2 item_size);
 CIMGUI_API bool igIsRectVisible2(CONST struct ImVec2 *rect_min, CONST struct ImVec2 *rect_max);
 CIMGUI_API float igGetTime();
 CIMGUI_API int igGetFrameCount();
+
+CIMGUI_API struct ImDrawList *igGetOverlayDrawList();
+CIMGUI_API struct ImDrawListSharedData *igGetDrawListSharedData();
+
 CIMGUI_API CONST char *igGetStyleColorName(ImGuiCol idx);
 CIMGUI_API void igCalcItemRectClosestPoint(struct ImVec2 *pOut, CONST struct ImVec2 pos, bool on_edge, float outward);
 CIMGUI_API void igCalcTextSize(struct ImVec2 *pOut, CONST char *text, CONST char *text_end, bool hide_text_after_double_hash, float wrap_width);
@@ -826,33 +931,35 @@ CIMGUI_API void igDestroyContext(struct ImGuiContext *ctx);
 CIMGUI_API struct ImGuiContext *igGetCurrentContext();
 CIMGUI_API void igSetCurrentContext(struct ImGuiContext *ctx);
 
+CIMGUI_API void ImFontConfig_DefaultConstructor(struct ImFontConfig *config);
+
 // ImGuiIO
 CIMGUI_API void ImGuiIO_AddInputCharacter(unsigned short c);
 CIMGUI_API void ImGuiIO_AddInputCharactersUTF8(CONST char *utf8_chars);
 CIMGUI_API void ImGuiIO_ClearInputCharacters();
 
 // ImGuiTextFilter
-CIMGUI_API struct ImGuiTextFilter *ImGuiTextFilter_Create(const char *default_filter);
+CIMGUI_API struct ImGuiTextFilter *ImGuiTextFilter_Create(CONST char *default_filter);
 CIMGUI_API void ImGuiTextFilter_Destroy(struct ImGuiTextFilter *filter);
 CIMGUI_API void ImGuiTextFilter_Clear(struct ImGuiTextFilter *filter);
-CIMGUI_API bool ImGuiTextFilter_Draw(struct ImGuiTextFilter *filter, const char *label, float width);
-CIMGUI_API bool ImGuiTextFilter_PassFilter(const struct ImGuiTextFilter *filter, const char *text, const char *text_end);
-CIMGUI_API bool ImGuiTextFilter_IsActive(const struct ImGuiTextFilter *filter);
+CIMGUI_API bool ImGuiTextFilter_Draw(struct ImGuiTextFilter *filter, CONST char *label, float width);
+CIMGUI_API bool ImGuiTextFilter_PassFilter(CONST struct ImGuiTextFilter *filter, CONST char *text, CONST char *text_end);
+CIMGUI_API bool ImGuiTextFilter_IsActive(CONST struct ImGuiTextFilter *filter);
 CIMGUI_API void ImGuiTextFilter_Build(struct ImGuiTextFilter *filter);
-CIMGUI_API const char *ImGuiTextFilter_GetInputBuf(struct ImGuiTextFilter *filter);
+CIMGUI_API CONST char *ImGuiTextFilter_GetInputBuf(struct ImGuiTextFilter *filter);
 
 // ImGuiTextBuffer
 CIMGUI_API struct ImGuiTextBuffer *ImGuiTextBuffer_Create();
 CIMGUI_API void ImGuiTextBuffer_Destroy(struct ImGuiTextBuffer *buffer);
 CIMGUI_API char ImGuiTextBuffer_index(struct ImGuiTextBuffer *buffer, int i);
-CIMGUI_API const char *ImGuiTextBuffer_begin(const struct ImGuiTextBuffer *buffer);
-CIMGUI_API const char *ImGuiTextBuffer_end(const struct ImGuiTextBuffer *buffer);
-CIMGUI_API int ImGuiTextBuffer_size(const struct ImGuiTextBuffer *buffer);
+CIMGUI_API CONST char *ImGuiTextBuffer_begin(CONST struct ImGuiTextBuffer *buffer);
+CIMGUI_API CONST char *ImGuiTextBuffer_end(CONST struct ImGuiTextBuffer *buffer);
+CIMGUI_API int ImGuiTextBuffer_size(CONST struct ImGuiTextBuffer *buffer);
 CIMGUI_API bool ImGuiTextBuffer_empty(struct ImGuiTextBuffer *buffer);
 CIMGUI_API void ImGuiTextBuffer_clear(struct ImGuiTextBuffer *buffer);
-CIMGUI_API const char *ImGuiTextBuffer_c_str(const struct ImGuiTextBuffer *buffer);
-CIMGUI_API void ImGuiTextBuffer_append(struct ImGuiTextBuffer *buffer, const char *fmt, ...);
-CIMGUI_API void ImGuiTextBuffer_appendv(struct ImGuiTextBuffer *buffer, const char *fmt, va_list args);
+CIMGUI_API CONST char *ImGuiTextBuffer_c_str(CONST struct ImGuiTextBuffer *buffer);
+CIMGUI_API void ImGuiTextBuffer_appendf(struct ImGuiTextBuffer *buffer, CONST char *fmt, ...);
+CIMGUI_API void ImGuiTextBuffer_appendfv(struct ImGuiTextBuffer *buffer, CONST char *fmt, va_list args);
 
 // ImGuiStorage
 CIMGUI_API struct ImGuiStorage *ImGuiStorage_Create();
@@ -873,7 +980,7 @@ CIMGUI_API void ImGuiStorage_SetAllInt(struct ImGuiStorage *storage, int val);
 
 // ImGuiTextEditCallbackData
 CIMGUI_API void ImGuiTextEditCallbackData_DeleteChars(struct ImGuiTextEditCallbackData *data, int pos, int bytes_count);
-CIMGUI_API void ImGuiTextEditCallbackData_InsertChars(struct ImGuiTextEditCallbackData *data, int pos, const char *text, const char *text_end);
+CIMGUI_API void ImGuiTextEditCallbackData_InsertChars(struct ImGuiTextEditCallbackData *data, int pos, CONST char *text, CONST char *text_end);
 CIMGUI_API bool ImGuiTextEditCallbackData_HasSelection(struct ImGuiTextEditCallbackData *data);
 
 // ImGuiListClipper
@@ -916,8 +1023,9 @@ CIMGUI_API void ImDrawList_AddText(struct ImDrawList *list, CONST struct ImVec2
 CIMGUI_API void ImDrawList_AddTextExt(struct ImDrawList *list, CONST struct ImFont *font, float font_size, CONST struct ImVec2 pos, ImU32 col, CONST char *text_begin, CONST char *text_end, float wrap_width, CONST struct ImVec4 *cpu_fine_clip_rect);
 CIMGUI_API void ImDrawList_AddImage(struct ImDrawList *list, ImTextureID user_texture_id, CONST struct ImVec2 a, CONST struct ImVec2 b, CONST struct ImVec2 uv_a, CONST struct ImVec2 uv_b, ImU32 col);
 CIMGUI_API void ImDrawList_AddImageQuad(struct ImDrawList *list, ImTextureID user_texture_id, CONST struct ImVec2 a, CONST struct ImVec2 b, CONST struct ImVec2 c, CONST struct ImVec2 d, CONST struct ImVec2 uv_a, CONST struct ImVec2 uv_b, CONST struct ImVec2 uv_c, CONST struct ImVec2 uv_d, ImU32 col);
-CIMGUI_API void ImDrawList_AddPolyline(struct ImDrawList *list, CONST struct ImVec2 *points, CONST int num_points, ImU32 col, bool closed, float thickness, bool anti_aliased);
-CIMGUI_API void ImDrawList_AddConvexPolyFilled(struct ImDrawList *list, CONST struct ImVec2 *points, CONST int num_points, ImU32 col, bool anti_aliased);
+CIMGUI_API void ImDrawList_AddImageRounded(struct ImDrawList *list, ImTextureID user_texture_id, CONST struct ImVec2 a, CONST struct ImVec2 b, CONST struct ImVec2 uv_a, CONST struct ImVec2 uv_b, ImU32 col, float rounding, int rounding_corners);
+CIMGUI_API void ImDrawList_AddPolyline(struct ImDrawList *list, CONST struct ImVec2 *points, CONST int num_points, ImU32 col, bool closed, float thickness);
+CIMGUI_API void ImDrawList_AddConvexPolyFilled(struct ImDrawList *list, CONST struct ImVec2 *points, CONST int num_points, ImU32 col);
 CIMGUI_API void ImDrawList_AddBezierCurve(struct ImDrawList *list, CONST struct ImVec2 pos0, CONST struct ImVec2 cp0, CONST struct ImVec2 cp1, CONST struct ImVec2 pos1, ImU32 col, float thickness, int num_segments);
 
 // Stateful path API, add points then finish with PathFill() or PathStroke()
@@ -953,7 +1061,7 @@ CIMGUI_API void ImDrawList_UpdateTextureID(struct ImDrawList *list);
 
 // ImDrawData
 CIMGUI_API void ImDrawData_DeIndexAllBuffers(struct ImDrawData *drawData);
-CIMGUI_API void ImDrawData_ScaleClipRects(struct ImDrawData *drawData, const struct ImVec2 sc);
+CIMGUI_API void ImDrawData_ScaleClipRects(struct ImDrawData *drawData, CONST struct ImVec2 sc);
 
 // ImFontAtlas
 CIMGUI_API void ImFontAtlas_GetTexDataAsRGBA32(struct ImFontAtlas *atlas, unsigned char **out_pixels, int *out_width, int *out_height, int *out_bytes_per_pixel);
@@ -990,37 +1098,38 @@ CIMGUI_API int ImFontAtlas_Fonts_size(struct ImFontAtlas *atlas);
 CIMGUI_API struct ImFont *ImFontAtlas_Fonts_index(struct ImFontAtlas *atlas, int index);
 
 // ImFont
-CIMGUI_API float ImFont_GetFontSize(const struct ImFont *font);
+CIMGUI_API float ImFont_GetFontSize(CONST struct ImFont *font);
 CIMGUI_API void ImFont_SetFontSize(struct ImFont *font, float FontSize_);
-CIMGUI_API float ImFont_GetScale(const struct ImFont *font);
+CIMGUI_API float ImFont_GetScale(CONST struct ImFont *font);
 CIMGUI_API void ImFont_SetScale(struct ImFont *font, float Scale_);
-CIMGUI_API void ImFont_GetDisplayOffset(const struct ImFont *font, struct ImVec2 *pOut);
-CIMGUI_API const struct IMFONTGLYPH *ImFont_GetFallbackGlyph(const struct ImFont *font);
-CIMGUI_API void ImFont_SetFallbackGlyph(struct ImFont *font, const struct IMFONTGLYPH *FallbackGlyph_);
-CIMGUI_API float ImFont_GetFallbackXAdvance(const struct ImFont *font);
-CIMGUI_API ImWchar ImFont_GetFallbackChar(const struct ImFont *font);
-CIMGUI_API short ImFont_GetConfigDataCount(const struct ImFont *font);
+CIMGUI_API void ImFont_GetDisplayOffset(CONST struct ImFont *font, struct ImVec2 *pOut);
+CIMGUI_API CONST struct IMFONTGLYPH *ImFont_GetFallbackGlyph(CONST struct ImFont *font);
+CIMGUI_API void ImFont_SetFallbackGlyph(struct ImFont *font, CONST struct IMFONTGLYPH *FallbackGlyph_);
+CIMGUI_API float ImFont_GetFallbackAdvanceX(CONST struct ImFont *font);
+CIMGUI_API ImWchar ImFont_GetFallbackChar(CONST struct ImFont *font);
+CIMGUI_API short ImFont_GetConfigDataCount(CONST struct ImFont *font);
 CIMGUI_API struct ImFontConfig *ImFont_GetConfigData(struct ImFont *font);
 CIMGUI_API struct ImFontAtlas *ImFont_GetContainerAtlas(struct ImFont *font);
-CIMGUI_API float ImFont_GetAscent(const struct ImFont *font);
-CIMGUI_API float ImFont_GetDescent(const struct ImFont *font);
-CIMGUI_API int ImFont_GetMetricsTotalSurface(const struct ImFont *font);
+CIMGUI_API float ImFont_GetAscent(CONST struct ImFont *font);
+CIMGUI_API float ImFont_GetDescent(CONST struct ImFont *font);
+CIMGUI_API int ImFont_GetMetricsTotalSurface(CONST struct ImFont *font);
 CIMGUI_API void ImFont_ClearOutputData(struct ImFont *font);
 CIMGUI_API void ImFont_BuildLookupTable(struct ImFont *font);
-CIMGUI_API const struct IMFONTGLYPH *ImFont_FindGlyph(const struct ImFont *font, ImWchar c);
+CIMGUI_API CONST struct IMFONTGLYPH *ImFont_FindGlyph(CONST struct ImFont *font, ImWchar c);
 CIMGUI_API void ImFont_SetFallbackChar(struct ImFont *font, ImWchar c);
-CIMGUI_API float ImFont_GetCharAdvance(const struct ImFont *font, ImWchar c);
-CIMGUI_API bool ImFont_IsLoaded(const struct ImFont *font);
-CIMGUI_API void ImFont_CalcTextSizeA(const struct ImFont *font, struct ImVec2 *pOut, float size, float max_width, float wrap_width, const char *text_begin, const char *text_end, const char **remaining); // utf8
-CIMGUI_API const char *ImFont_CalcWordWrapPositionA(const struct ImFont *font, float scale, const char *text, const char *text_end, float wrap_width);
-CIMGUI_API void ImFont_RenderChar(const struct ImFont *font, struct ImDrawList *draw_list, float size, struct ImVec2 pos, ImU32 col, unsigned short c);
-CIMGUI_API void ImFont_RenderText(const struct ImFont *font, struct ImDrawList *draw_list, float size, struct ImVec2 pos, ImU32 col, const struct ImVec4 *clip_rect, const char *text_begin, const char *text_end, float wrap_width, bool cpu_fine_clip);
+CIMGUI_API float ImFont_GetCharAdvance(CONST struct ImFont *font, ImWchar c);
+CIMGUI_API bool ImFont_IsLoaded(CONST struct ImFont *font);
+CIMGUI_API CONST char *ImFont_GetDebugName(CONST struct ImFont *font);
+CIMGUI_API void ImFont_CalcTextSizeA(CONST struct ImFont *font, struct ImVec2 *pOut, float size, float max_width, float wrap_width, CONST char *text_begin, CONST char *text_end, CONST char **remaining); // utf8
+CIMGUI_API CONST char *ImFont_CalcWordWrapPositionA(CONST struct ImFont *font, float scale, CONST char *text, CONST char *text_end, float wrap_width);
+CIMGUI_API void ImFont_RenderChar(CONST struct ImFont *font, struct ImDrawList *draw_list, float size, struct ImVec2 pos, ImU32 col, unsigned short c);
+CIMGUI_API void ImFont_RenderText(CONST struct ImFont *font, struct ImDrawList *draw_list, float size, struct ImVec2 pos, ImU32 col, CONST struct ImVec4 *clip_rect, CONST char *text_begin, CONST char *text_end, float wrap_width, bool cpu_fine_clip);
 // ImFont::Glyph
-CIMGUI_API int ImFont_Glyphs_size(const struct ImFont *font);
+CIMGUI_API int ImFont_Glyphs_size(CONST struct ImFont *font);
 CIMGUI_API struct IMFONTGLYPH *ImFont_Glyphs_index(struct ImFont *font, int index);
 // ImFont::IndexXAdvance
-CIMGUI_API int ImFont_IndexXAdvance_size(const struct ImFont *font);
-CIMGUI_API float ImFont_IndexXAdvance_index(const struct ImFont *font, int index);
+CIMGUI_API int ImFont_IndexXAdvance_size(CONST struct ImFont *font);
+CIMGUI_API float ImFont_IndexXAdvance_index(CONST struct ImFont *font, int index);
 // ImFont::IndexLookup
-CIMGUI_API int ImFont_IndexLookup_size(const struct ImFont *font);
-CIMGUI_API unsigned short ImFont_IndexLookup_index(const struct ImFont *font, int index);
+CIMGUI_API int ImFont_IndexLookup_size(CONST struct ImFont *font);
+CIMGUI_API unsigned short ImFont_IndexLookup_index(CONST struct ImFont *font, int index);

@malikolivier
Copy link
Collaborator Author

@Gekkio I added all the new bindings. I consider this PR ready. Are the updates to the CHANGELOG ok to you?

@Lymia
Copy link
Contributor

Lymia commented May 5, 2018

I added ImFontConfig::new() due to ImFontConfig_DefaultConstructor being missing. May want to hook that up to ImFontConfig_DefaultConstructor, instead of being an reimplementation.

@malikolivier
Copy link
Collaborator Author

@Lymia Thanks for the tip, 👍 I added a commit implementing your idea. Would you take time to take a look? 😄

@Lymia
Copy link
Contributor

Lymia commented May 5, 2018

... It should be fine? I don't actually know if C++ constructors have an issue with mem::uninitialized in that usage.

@malikolivier
Copy link
Collaborator Author

@Lymia I think it should be fine. ImFontConfig_DefaultConstructor does not behave as a C++ constructor, but as a C function that mutates (and in this specific case, initializes) an instance of sys::ImFontConfig.

@Gekkio
Copy link
Contributor

Gekkio commented May 7, 2018

Are the updates to the CHANGELOG ok to you?

The change log looks good otherwise, but it doesn't follow the existing section structure (e.g. Added, Changed, Deprecated...). I've tried to follow the example structure here: https://keepachangelog.com/en/1.0.0/

@malikolivier
Copy link
Collaborator Author

@Gekkio Here you are. I updated the CHANGELOG following the keepachangelog structure.

@Gekkio
Copy link
Contributor

Gekkio commented May 13, 2018

Very good job! I reviewed the changes and I'll merge this after one last fix: there's a StyleVar called WindowBorderSize that was added but it's still missing from imgui-rs. It should be added to both the sys crate and the main crate, and based on the name it sounds like it's the one that should be used as a replacement for the old borders boolean flag..?

Use WindowBorderSize as replacement for border boolean in window.rs
@malikolivier
Copy link
Collaborator Author

@Gekkio Oh, it seems I missed this one, WindowBorderSize! Thanks! I just committed my changes in 500e64d.

@Gekkio
Copy link
Contributor

Gekkio commented May 14, 2018

Excellent! Merging 😄

@Gekkio Gekkio merged commit c838bc1 into imgui-rs:master May 14, 2018
@o01eg
Copy link
Contributor

o01eg commented May 16, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants