// Wrapping access to backend data (to facilitate multiple-contexts stored in io.BackendPlatformUserData)
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts
staticImGui_ImplAllegro5_Data*g_Data;
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Wrapping access to backend data (to facilitate multiple-contexts stored in io.BackendPlatformUserData)
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
staticImGui_ImplDX12_Data*g_Data;
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Wrapping access to backend data (to facilitate multiple-contexts stored in io.BackendPlatformUserData)
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts
staticImGui_ImplGlfw_Data*g_Data;
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Wrapping access to backend data (to facilitate multiple-contexts stored in io.BackendPlatformUserData)
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
staticImGui_ImplOpenGL2_Data*g_Data;
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Wrapping access to backend data (to facilitate multiple-contexts stored in io.BackendPlatformUserData)
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
staticImGui_ImplOpenGL3_Data*g_Data;
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// (minor and older changes stripped away, please see git history for details)
// (minor and older changes stripped away, please see git history for details)
// 2021-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2021-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2021-06:29: *BREAKING CHANGE* Removed 'SDL_Window* window' parameter to ImGui_ImplSDL2_NewFrame() which was unnecessary.
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
// Wrapping access to backend data data (to facilitate multiple-contexts stored in io.BackendPlatformUserData)
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts
staticImGui_ImplSDL2_Data*g_Data;
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
// FIXME: multi-context support is not tested and probably dysfunctional in this backend.
// Backend data stored in io.BackendPlatformUserData to allow support for multiple Dear ImGui contexts
// Wrapping access to backend data (to facilitate multiple-contexts stored in io.BackendPlatformUserData)
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
staticImGui_ImplWin32_Data*g_Data;
// FIXME: multi-context support is not well tested and probably dysfunctional in this backend.
@ -160,8 +160,9 @@ Console SDK also sometimes provide equivalent tooling or wrapper for Synergy-lik
---
---
### Q: I integrated Dear ImGui in my engine and little squares are showing instead of text...
### Q: I integrated Dear ImGui in my engine and little squares are showing instead of text...
This usually means that: your font texture wasn't uploaded into GPU, or your shader or other rendering state are not reading from the right texture (e.g. texture wasn't bound).
Your renderer is not using the font texture correctly or it hasn't be uploaded to GPU.
If this happens using the standard backends it is probably that the texture failed to upload, which could happens if for some reason your texture is too big. Also see [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md).
- If this happens using the standard backends: A) have you modified the font atlas after `ImGui_ImplXXX_NewFrame()`? B) maybe the texture failed to upload, which could happens if for some reason your texture is too big. Also see [docs/FONTS.md](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md).
- If this happens with a custom backend: make sure you have uploaded the font texture to the GPU, that all shaders are rendering states are setup properly (e.g. texture is bound). Compare your code to existing backends and use a graphics debugger such as [RenderDoc](https://renderdoc.org) to debug your rendering states.
@ -655,7 +656,7 @@ There is an auto-generated [c-api for Dear ImGui (cimgui)](https://github.com/ci
- Individuals: you can support continued maintenance and development via PayPal donations. See [README](https://github.com/ocornut/imgui/blob/master/docs/README.md).
- Individuals: you can support continued maintenance and development via PayPal donations. See [README](https://github.com/ocornut/imgui/blob/master/docs/README.md).
- If you are experienced with Dear ImGui and C++, look at [GitHub Issues](https://github.com/ocornut/imgui/issues), [GitHub Discussions](https://github.com/ocornut/imgui/discussions), the [Wiki](https://github.com/ocornut/imgui/wiki), read [docs/TODO.txt](https://github.com/ocornut/imgui/blob/master/docs/TODO.txt) and see how you want to help and can help!
- If you are experienced with Dear ImGui and C++, look at [GitHub Issues](https://github.com/ocornut/imgui/issues), [GitHub Discussions](https://github.com/ocornut/imgui/discussions), the [Wiki](https://github.com/ocornut/imgui/wiki), read [docs/TODO.txt](https://github.com/ocornut/imgui/blob/master/docs/TODO.txt) and see how you want to help and can help!
- Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
- Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
You may post screenshot or links in the [gallery threads](https://github.com/ocornut/imgui/issues/3488). Visuals are ideal as they inspire other programmers. Disclosing your use of Dear ImGui helps the library grow credibility, and help other teams and programmers with taking decisions.
You may post screenshot or links in the [gallery threads](https://github.com/ocornut/imgui/issues/3793). Visuals are ideal as they inspire other programmers. Disclosing your use of Dear ImGui helps the library grow credibility, and help other teams and programmers with taking decisions.
- If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues or sometimes incomplete PR.
- If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues or sometimes incomplete PR.
@ -141,7 +141,7 @@ Some of the goals for 2021 are:
### Gallery
### Gallery
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/3488)!
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/3793)!
For a list of third-party widgets and extensions, check out the [Useful Extensions/Widgets](https://github.com/ocornut/imgui/wiki/Useful-Extensions) wiki page.
For a list of third-party widgets and extensions, check out the [Useful Extensions/Widgets](https://github.com/ocornut/imgui/wiki/Useful-Extensions) wiki page.
@ -174,7 +174,7 @@ Advanced users may want to use the `docking` branch with [Multi-Viewport](https:
**Who uses Dear ImGui?**
**Who uses Dear ImGui?**
See the [Quotes](https://github.com/ocornut/imgui/wiki/Quotes), [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors), [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages for an idea of who is using Dear ImGui. Please add your game/software if you can! Also see the [Gallery Threads](https://github.com/ocornut/imgui/issues/3488)!
See the [Quotes](https://github.com/ocornut/imgui/wiki/Quotes), [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors), [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages for an idea of who is using Dear ImGui. Please add your game/software if you can! Also see the [Gallery Threads](https://github.com/ocornut/imgui/issues/3793)!
//---- Don't implement some functions to reduce linkage requirements.
//---- Don't implement some functions to reduce linkage requirements.
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] Don't implement default IME handler. Won't use and link with ImmGetContext/ImmSetCompositionWindow. (imm32.lib/.a)
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
// - Those can be nested but this cannot be used to enable an already disabled section (a single PushDisabled(true) in the stack is enough to keep things disabled)
// - Those are not yet exposed in imgui.h because we are unsure of how to alter the style in a way that works for everyone.
// - Those are not yet exposed in imgui.h because we are unsure of how to alter the style in a way that works for everyone.
// We may rework this. Hypothetically, a future styling system may set a flag which make widgets use different colors.
// We may rework this. Hypothetically, a future styling system may set a flag which make widgets use different colors.
// - Feedback welcome at https://github.com/ocornut/imgui/issues/211
// - Feedback welcome at https://github.com/ocornut/imgui/issues/211
// - You may trivially implement your own variation of this if needed.
// - You may trivially implement your own variation of this if needed.
// Here we test (CurrentItemFlags & ImGuiItemFlags_Disabled) to allow nested PushDisabled() calls.
// Here we test (CurrentItemFlags & ImGuiItemFlags_Disabled) to allow nested PushDisabled() calls.
// FIXME-DRAGDROP: Settle on a proper default visuals for drop target.
payload.Preview=was_accepted_previously;
payload.Preview=was_accepted_previously;
flags|=(g.DragDropSourceFlags&ImGuiDragDropFlags_AcceptNoDrawDefaultRect);// Source can also inhibit the preview (useful for external sources that lives for 1 frame)
flags|=(g.DragDropSourceFlags&ImGuiDragDropFlags_AcceptNoDrawDefaultRect);// Source can also inhibit the preview (useful for external sources that lives for 1 frame)
payload.Delivery=was_accepted_previously&&!IsMouseDown(g.DragDropMouseButton);// For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased()
payload.Delivery=was_accepted_previously&&!IsMouseDown(g.DragDropMouseButton);// For extern drag sources affecting os window focus, it's easier to just test !IsMouseDown() instead of IsMouseReleased()
Text("HoveredId: 0x%08X/0x%08X (%.2f sec), AllowOverlap: %d",g.HoveredId,g.HoveredIdPreviousFrame,g.HoveredIdTimer,g.HoveredIdAllowOverlap);// Data is "in-flight" so depending on when the Metrics window is called we may see current frame information or not
Text("HoveredId: 0x%08X (%.2f sec), AllowOverlap: %d",g.HoveredIdPreviousFrame,g.HoveredIdTimer,g.HoveredIdAllowOverlap);// Not displaying g.HoveredId as it is update mid-frame
// (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)
boolIsBuilt()const{returnFonts.Size>0&&TexReady;}// Bit ambiguous: used to detect when user didn't built texture but effectively we should check TexID != 0 except that would be backend dependent...
voidSetTexID(ImTextureIDid){TexID=id;}
voidSetTexID(ImTextureIDid){TexID=id;}
//-------------------------------------------
//-------------------------------------------
@ -2782,6 +2782,7 @@ struct ImFontAtlas
// [Internal]
// [Internal]
// NB: Access texture data via GetTexData*() calls! Which will setup a default font for you.
// NB: Access texture data via GetTexData*() calls! Which will setup a default font for you.
boolTexReady;// Set when texture was built matching current font input
boolTexPixelsUseColors;// Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format.
boolTexPixelsUseColors;// Tell whether our texture data is known to use colors (rather than just alpha channel), in order to help backend select a format.
unsignedchar*TexPixelsAlpha8;// 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
unsignedchar*TexPixelsAlpha8;// 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
unsignedint*TexPixelsRGBA32;// 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
unsignedint*TexPixelsRGBA32;// 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
ImGuiItemFlags_NoTabStop=1<<0,// false // Disable keyboard tabbing (FIXME: should merge with _NoNav)
ImGuiItemFlags_ButtonRepeat=1<<1,// false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
ImGuiItemFlags_ButtonRepeat=1<<1,// false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
ImGuiItemFlags_Disabled=1<<2,// false // [BETA] Disable interactions but doesn't affect visuals yet. See github.com/ocornut/imgui/issues/211
ImGuiItemFlags_Disabled=1<<2,// false // Disable interactions but doesn't affect visuals. See PushDisabled()/PushDisabled(). See github.com/ocornut/imgui/issues/211
ImGuiItemFlags_NoNav=1<<3,// false
ImGuiItemFlags_NoNav=1<<3,// false // Disable keyboard/gamepad directional navigation (FIXME: should merge with _NoTabStop)
ImGuiItemFlags_NoNavDefaultFocus=1<<4,// false
ImGuiItemFlags_NoNavDefaultFocus=1<<4,// false // Disable item being a candidate for default focus (e.g. used by title bar items)
ImGuiItemFlags_SelectableDontClosePopup=1<<5,// false // MenuItem/Selectable() automatically closes current Popup window
ImGuiItemFlags_SelectableDontClosePopup=1<<5,// false // Disable MenuItem/Selectable() automatically closing their popup window
ImGuiItemFlags_MixedValue=1<<6,// false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
ImGuiItemFlags_MixedValue=1<<6,// false // [BETA] Represent a mixed/indeterminate value, generally multi-selection where values differ. Currently only supported by Checkbox() (later should support all sorts of widgets)
ImGuiItemFlags_ReadOnly=1<<7// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
ImGuiItemFlags_ReadOnly=1<<7// false // [ALPHA] Allow hovering interactions but underlying value is not changed.
};
};
// Flags for ItemAdd()
// Flags for ItemAdd()
@ -810,7 +810,7 @@ enum ImGuiButtonFlagsPrivate_
ImGuiButtonFlags_FlattenChildren=1<<11,// allow interactions even if a child window is overlapping
ImGuiButtonFlags_FlattenChildren=1<<11,// allow interactions even if a child window is overlapping
ImGuiButtonFlags_AllowItemOverlap=1<<12,// require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
ImGuiButtonFlags_AllowItemOverlap=1<<12,// require previous frame HoveredId to either match id or be null before being usable, use along with SetItemAllowOverlap()
ImGuiButtonFlags_DontClosePopups=1<<13,// disable automatically closing parent popup on press // [UNUSED]
ImGuiButtonFlags_DontClosePopups=1<<13,// disable automatically closing parent popup on press // [UNUSED]
//ImGuiButtonFlags_Disabled = 1 << 14, // disable interactions -> use PushDisabled() or ImGuiItemFlags_Disabled
ImGuiButtonFlags_AlignTextBaseLine=1<<15,// vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
ImGuiButtonFlags_AlignTextBaseLine=1<<15,// vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
ImGuiButtonFlags_NoKeyModifiers=1<<16,// disable mouse interaction if a key modifier is held
ImGuiButtonFlags_NoKeyModifiers=1<<16,// disable mouse interaction if a key modifier is held
ImGuiButtonFlags_NoHoldingActiveId=1<<17,// don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
ImGuiButtonFlags_NoHoldingActiveId=1<<17,// don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
IMGUI_APIboolIsItemToggledSelection();// Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
IMGUI_APIboolIsItemToggledSelection();// Was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
window->DC.CursorPos.x+=IM_FLOOR(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().
window->DC.CursorPos.x+=IM_FLOOR(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().
window->DC.CursorPos.x+=IM_FLOOR(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().
window->DC.CursorPos.x+=IM_FLOOR(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().