@ -39,9 +39,11 @@ Dear ImGui is particularly suited to integration in game engines (for tooling),
### Usage
**The core of Dear ImGui is self-contained within a few platform-agnostic files** which you can easily compile in your application/engine. They are all the files in the root folder of the repository (imgui*.cpp, imgui*.h). **No specific build process is required**. You can add the .cpp files into your existing project. See [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started).
**The core of Dear ImGui is self-contained within a few platform-agnostic files** which you can easily compile in your application/engine. They are all the files in the root folder of the repository (imgui*.cpp, imgui*.h). **No specific build process is required**. You can add the .cpp files into your existing project.
**Backends for a variety of graphics API and rendering platforms** are provided in the [backends/](https://github.com/ocornut/imgui/tree/master/backends) folder, along with example applications in the [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder. See the [Integration](#integration) section of this document for details. You may also create your own backend. Anywhere where you can render textured triangles, you can render Dear ImGui.
**Backends for a variety of graphics API and rendering platforms** are provided in the [backends/](https://github.com/ocornut/imgui/tree/master/backends) folder, along with example applications in the [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder. You may also create your own backend. Anywhere where you can render textured triangles, you can render Dear ImGui.
See the [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started) guide and [Integration](#integration) section of this document for more details.
After Dear ImGui is set up in your application, you can use it from \_anywhere\_ in your program loop:
```cpp
@ -114,9 +116,11 @@ The demo applications are not DPI aware so expect some blurriness on a 4K screen
### Integration
See the [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started) guide for details.
On most platforms and when using C++, **you should be able to use a combination of the [imgui_impl_xxxx](https://github.com/ocornut/imgui/tree/master/backends) backends without modification** (e.g. `imgui_impl_win32.cpp` + `imgui_impl_dx11.cpp`). If your engine supports multiple platforms, consider using more imgui_impl_xxxx files instead of rewriting them: this will be less work for you, and you can get Dear ImGui running immediately. You can _later_ decide to rewrite a custom backend using your custom engine functions if you wish so.
See [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started). Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/keyboard/gamepad inputs 2) uploading a texture to your GPU/render engine 3) providing a render function that can bind textures and render textured triangles, which is essentially what Backends are doing. The [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder is populated with applications doing just that: setting up a window and using backends. If you follow [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started) it should in theory takes you less than an hour to integrate Dear ImGui. **Make sure to spend time reading the [FAQ](https://www.dearimgui.com/faq), comments, and the examples applications!**
Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/keyboard/gamepad inputs 2) uploading a texture to your GPU/render engine 3) providing a render function that can bind textures and render textured triangles, which is essentially what Backends are doing. The [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder is populated with applications doing just that: setting up a window and using backends. If you follow the [Getting Started](https://github.com/ocornut/imgui/wiki/Getting-Started) guide it should in theory takes you less than an hour to integrate Dear ImGui. **Make sure to spend time reading the [FAQ](https://www.dearimgui.com/faq), comments, and the examples applications!**
Officially maintained backends/bindings (in repository):
// - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use ImGui::PushFont()/PopFont() to select them.
FrameBorderSize=0.0f;// Thickness of border around frames. Generally set to 0.0f or 1.0f. Other values not well tested.
ItemSpacing=ImVec2(8,4);// Horizontal and vertical spacing between widgets/lines
ItemInnerSpacing=ImVec2(4,4);// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
CellPadding=ImVec2(4,2);// Padding within a table cell
CellPadding=ImVec2(4,2);// Padding within a table cell. CellPadding.y may be altered between different rows.
TouchExtraPadding=ImVec2(0,0);// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
IndentSpacing=21.0f;// Horizontal spacing when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
ColumnsMinSpacing=6.0f;// Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
// - Very important: when a starting position is after our maximum item, we set Min to (ItemsCount - 1). This allows us to handle most forms of wrapping.
// - Due to how Selectable extra padding they tend to be "unaligned" with exact unit in the item list,
// which with the flooring/ceiling tend to lead to 2 items instead of one being submitted.
if(!popup_window->Active&&!popup_window->WasActive)// Check WasActive, because this code may run before popup renders on current frame, also check Active to handle newly created windows.
IM_ASSERT(!scoring_rect.IsInverted());// Ensure if we have a finite, non-inverted bounding box here will allow us to remove extraneous ImFabs() calls in NavScoreItem().
IM_ASSERT(!scoring_rect.IsInverted());// Ensure we have a non-inverted bounding box here will allow us to remove extraneous ImFabs() calls in NavScoreItem().
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.89.9 WIP"
#define IMGUI_VERSION_NUM 18983
#define IMGUI_VERSION "1.89.9"
#define IMGUI_VERSION_NUM 18990
#define IMGUI_HAS_TABLE
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
#define IMGUI_HAS_DOCK // Docking WIP branch
@ -1977,7 +1977,7 @@ struct ImGuiStyle
floatFrameBorderSize;// Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
ImVec2ItemSpacing;// Horizontal and vertical spacing between widgets/lines.
ImVec2ItemInnerSpacing;// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
ImVec2CellPadding;// Padding within a table cell
ImVec2CellPadding;// Padding within a table cell. CellPadding.y may be altered between different rows.
ImVec2TouchExtraPadding;// Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
floatIndentSpacing;// Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
floatColumnsMinSpacing;// Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
@ -2518,12 +2518,14 @@ struct ImGuiListClipper
IMGUI_APIvoidEnd();// Automatically called on the last call of Step() that returns false.
IMGUI_APIboolStep();// Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
// Call IncludeRangeByIndices() *BEFORE* first call to Step() if you need a range of items to not be clipped, regardless of their visibility.
// Call IncludeItemByIndex() or IncludeItemsByIndex() *BEFORE* first call to Step() if you need a range of items to not be clipped, regardless of their visibility.
// (Due to alignment / padding of certain items it is possible that an extra item may be included on either end of the display range).
IMGUI_APIvoidIncludeRangeByIndices(intitem_begin,intitem_end);// item_end is exclusive e.g. use (42, 42+1) to make item 42 never clipped.
if(show_app_dockspace)ShowExampleAppDockSpace(&show_app_dockspace);// Process the Docking app first, as explicit DockSpace() nodes needs to be submitted early (read comments near the DockSpace function)
if(show_app_documents)ShowExampleAppDocuments(&show_app_documents);// Process the Document app next, as it may also use a DockSpace()
HelpMarker("You can pass a 'min_row_height' to TableNextRow().\n\nRows are padded with 'style.CellPadding.y' on top and bottom, so effectively the minimum row height will always be >= 'style.CellPadding.y * 2.0f'.\n\nWe cannot honor a _maximum_ row height as that would require a unique clipping rectangle per row.");
window->DC.CursorPosPrevLine=ImVec2(window->DC.CursorPos.x,window->DC.CursorPos.y+table->RowCellPaddingY);// This allows users to call SameLine() to share LineSize between columns.
window->DC.PrevLineSize=window->DC.CurrLineSize=ImVec2(0.0f,0.0f);// This allows users to call SameLine() to share LineSize between columns, and to call it from first column too.
window->DC.IsSameLine=window->DC.IsSetPos=false;
window->DC.CursorMaxPos.y=next_y1;
@ -2013,10 +2016,10 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
start_x+=table->RowIndentOffsetX;// ~~ += window.DC.Indent.x - table->HostIndentX, except we locked it for the row.
window->DC.CursorPosPrevLine=window->DC.CursorPos;// This allows users to call SameLine() to share LineSize between columns.
window->DC.CursorPosPrevLine.x=window->DC.CursorPos.x;// PrevLine.y is preserved. This allows users to call SameLine() to share LineSize between columns.
// Read imgui.cpp "API BREAKING CHANGES" section for 1.78 if you hit this assert.
IM_ASSERT((flags==1||(flags&ImGuiSliderFlags_InvalidMask_)==0)&&"Invalid ImGuiSliderFlags flag! Has the 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead.");
// Those are the things we can do easily outside the SliderBehaviorT<> template, saves code generation.
ImVec2picker_size(g.FontSize*8,ImMax(g.FontSize*8-(GetFrameHeight()+g.Style.ItemInnerSpacing.x),1.0f));// FIXME: Picker size copied from main picker function