@ -25,6 +25,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- window: increase minimum size of a window with menus or fix the menu rendering so that it doesn't look odd.
- window: double-clicking on title bar to minimize isn't consistent, perhaps move to single-click on left-most collapse icon?
- window: expose contents size. (#1045)
- window: using SetWindowPos() inside Begin() and moving the window with the mouse reacts a very ugly glitch. We should just defer the SetWindowPos() call.
- window: GetWindowSize() returns (0,0) when not calculated? (#1045)
- window: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate.
!- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
@ -39,6 +40,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- drawlist: would be good to be able to deep copy of ImDrawData (we have a deep copy of ImDrawList now).
- drawlist/opt: AddRect() axis aligned pixel aligned (no-aa) could use 8 triangles instead of 16 and no normal calculation.
- drawlist: rendering: provide a way for imgui to output to a single/global vertex buffer, re-order indices only at the end of the frame (ref: https://gist.github.com/floooh/10388a0afbe08fce9e617d8aefa7d302)
- drawlist: callback: add an extra void* in ImDrawCallback to allow passing render-local data to the callback (would break API).
- main: considering adding an Init() function? some constructs are awkward in the implementation because of the lack of them.
- main: find a way to preserve relative orders of multiple reappearing windows (so an app toggling between "modes" e.g. fullscreen vs all tools) won't lose relative ordering.
// (minor and older changes stripped away, please see git history for details)
// 2018-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2018-XX-XX: OpenGL: Offset projection matrix and clipping rectangle by draw_data->DisplayPos (which will be non-zero for multi-viewport applications).
// 2018-05-14: OpenGL: Making the call to glBindSampler() optional so 3.2 context won't fail if the function is a NULL pointer.
// 2018-03-06: OpenGL: Added const char* glsl_version parameter to ImGui_ImplOpenGL3_Init() so user can override the GLSL version e.g. "#version 150".
// 2018-02-23: OpenGL: Create the VAO in the render function so the setup can more easily be used with multiple shared GL context.
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplSdlGL3_RenderDrawData() in the .h file so you can call it yourself.
glBindSampler(0,0);// Rely on combined texture/sampler state.
if(glBindSampler)glBindSampler(0,0);// We use combined texture/sampler state. Applications using GL 3.3 may set that otherwise.
// Recreate the VAO every time
// (This is to easily allow multiple GL contexts. VAO are not shared among GL contexts, and we don't track creation/deletion of windows so we don't have an obvious key to use to cache them.)
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
@ -711,6 +711,7 @@
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false
#pragma GCC diagnostic ignored "-Wclass-memaccess" // warning: ‘memset/memcpy’ clearing/writing an object of type ‘xxxx’ with no trivial copy-assignment; use assignment or value-initialization instead
#endif
// Enforce cdecl calling convention for functions called by the standard library, in case compilation settings changed the default to e.g. __vectorcall
// We perform scoring on items bounding box clipped by the current clipping rectangle on the other axis (clipping on our movement axis would give us equal scores for all clipped items)
// For example, this ensure that items in one column are not reached when moving vertically from items in another column.
// Forwarding previous request (which has been modified, e.g. wrap around menus rewrite the requests with a starting rectangle at the other side of the window)
IM_ASSERT(g.NavMoveDir!=ImGuiDir_None);
// (Preserve g.NavMoveRequestFlags, g.NavMoveClipDir which were set by the NavMoveRequestForward() function)
if(g.NavMoveRequest&&g.NavMoveDir==ImGuiDir_Up)// When performing a navigation request, ensure we have one item extra in the direction we are moving to
// When performing a navigation request, ensure we have one item extra in the direction we are moving to
window->DC.CursorPos.x+=(float)(int)(style.ItemSpacing.x*(-1.0f+0.5f));// -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
// Leaf: The only reason we have a TreeNode at all is to allow selection of the leaf. Otherwise we can use BulletText() or TreeAdvanceToLabelPos()+Text().
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
#pragma GCC diagnostic ignored "-Wclass-memaccess" // warning: ‘memset/memcpy’ clearing/writing an object of type ‘xxxx’ with no trivial copy-assignment; use assignment or value-initialization instead
structImRect;// An axis-aligned rectangle (2 points)
structImDrawDataBuilder;// Helper to build a ImDrawData instance
structImDrawListSharedData;// Data shared between all ImDrawList instances
structImGuiColMod;// Stacked color modifier, backup of modified data so we can restore it
structImGuiColumnData;// Storage data for a single column
structImGuiColumnsSet;// Storage data for a columns set
structImGuiContext;// Main imgui context
structImGuiGroupData;// Stacked storage data for BeginGroup()/EndGroup()
structImGuiItemHoveredDataBackup;// Backup and restore IsItemHovered() internal data
structImGuiMenuColumns;// Simple column measurement, currently used for MenuItem() only
structImGuiNavMoveResult;// Result of a directional navigation move query result
structImGuiNextWindowData;// Storage for SetNexWindow** functions
structImGuiPopupRef;// Storage for current popup stack
structImGuiSettingsHandler;
structImGuiStyleMod;// Stacked style modifier, backup of modified data so we can restore it
structImGuiTextEditState;// Internal state of the currently focused/edited text input box
structImGuiWindow;// Storage for one window
structImGuiWindowTempData;// Temporary storage for one, that's the data which in theory we could ditch at the end of the frame
structImGuiWindowSettings;// Storage for window settings stored in .ini file (we keep one of those even if the actual window wasn't instanced during this session)
typedefintImGuiLayoutType;// enum: horizontal or vertical // enum ImGuiLayoutType_
typedefintImGuiButtonFlags;// flags: for ButtonEx(), ButtonBehavior() // enum ImGuiButtonFlags_
@ -50,6 +59,7 @@ typedef int ImGuiItemFlags; // flags: for PushItemFlag()
typedefintImGuiItemStatusFlags;// flags: storage for DC.LastItemXXX // enum ImGuiItemStatusFlags_
typedefintImGuiNavHighlightFlags;// flags: for RenderNavHighlight() // enum ImGuiNavHighlightFlags_
typedefintImGuiNavDirSourceFlags;// flags: for GetNavInputAmount2d() // enum ImGuiNavDirSourceFlags_
typedefintImGuiNavMoveFlags;// flags: for navigation requests // enum ImGuiNavMoveFlags_
typedefintImGuiSeparatorFlags;// flags: for Separator() - internal // enum ImGuiSeparatorFlags_
typedefintImGuiSliderFlags;// flags: for SliderBehavior() // enum ImGuiSliderFlags_
@ -227,10 +237,11 @@ enum ImGuiColumnsFlags_
enumImGuiSelectableFlagsPrivate_
{
// NB: need to be in sync with last value of ImGuiSelectableFlags_
voidClipWith(constImRect&r){Min=ImMax(Min,r.Min);Max=ImMin(Max,r.Max);}// Simple version, may lead to an inverted rectangle, which is fine for Contains/Overlaps test but not for display.
voidClipWithFull(constImRect&r){Min=ImClamp(Min,r.Min,r.Max);Max=ImClamp(Max,r.Min,r.Max);}// Full version, ensure both points are fully clipped.
floatColumnsOffsetX;// Offset to the current column (if ColumnsCurrent > 0). FIXME: This and the above should be a stack to allow use cases like Tree->Column->Tree. Need revamp columns API.
ImVec2SetWindowPosVal;// store window position when using a non-zero Pivot (position set needs to be processed when we know the window size)
ImVec2SetWindowPosPivot;// store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right.
ImGuiDrawContext DC;// Temporary per-window data, reset at the beginning of the frame
ImGuiWindowTempDataDC;// Temporary per-window data, reset at the beginning of the frame. This used to be called ImGuiDrawContext, hence the "DC" variable name.
ImVector<ImGuiID>IDStack;// ID stack. ID are hashes seeded with the value at the top of the stack
IMGUI_APIvoidActivateItem(ImGuiIDid);// Remotely activate a button, checkbox, tree node etc. given its unique ID. activation is queued and processed on the next frame when the item is encountered again.