Skip to content

Update Dear ImGui to v1.91#113

Open
lshoek wants to merge 24 commits into
napframework:mainfrom
lshoek:imgui_update
Open

Update Dear ImGui to v1.91#113
lshoek wants to merge 24 commits into
napframework:mainfrom
lshoek:imgui_update

Conversation

@lshoek

@lshoek lshoek commented Oct 22, 2025

Copy link
Copy Markdown
Contributor
  • Updates Dear ImGui to version 1.91.9b. I deliberately chose this version as 1.92 introduces some large changes to the rendering backends and fonts.
  • Adapted napimgui and nap::ImGuiService to deal with the increased responsibility over input management on the ImGui side.

There are a few breaking changes in the ImGui API, but they are well documented. Instances of commonly used functions include:

  • ImGui::SliderFloat
  • ImGui::InputFloat
  • ImGui::GetKeyIndex

@cklosters

Copy link
Copy Markdown
Member

So what's the actual reason to push this? Are there any new features you really need?

@lshoek

lshoek commented Nov 5, 2025

Copy link
Copy Markdown
Contributor Author

The big one for me is the feature-rich tables API. Very powerful for creating monitors and control panels for lots of elements/devices/agents etc. The previous columns API was rather clunky. There are also options to view-clip large lists. Other than that I've been inconvenienced more frequently by small quirks and issues that were addressed in later versions.

@cklosters

Copy link
Copy Markdown
Member

Thanks for the clarification, makes sense; I'm currently working on a lot of GUI specific code, probably good to merge this change into NAP and use that as a base instead of our current version of ImGUI, but that won't be immediately unfortunately because I'm rather busy getting some other things off the ground.

@lshoek lshoek self-assigned this Mar 4, 2026
@cklosters

Copy link
Copy Markdown
Member

Trying your version, noticed that icons are rendered incorrect:

yours:

Screenshot 2026-06-19 141549

current:

image

ImGui::PlotHistogram("Histogram", mPlotvalues.data(), mPlotvalues.size(), mTickIdx, nullptr, 0.0f, 0.2f, ImVec2(ImGui::GetColumnWidth(), 128)); // Plot the output values
ImGui::SliderFloat("Filter Frequency", &mAnalysisFrequency, 0.0f, 10000.0f, "%.3f", 2.0f);
ImGui::SliderFloat("Filter Bandwidth", &mAnalysisBand, 1.f, 10000.0f, "%.3f", 2.0f);
ImGui::SliderFloat("Filter Frequency", &mAnalysisFrequency, 0.0f, 10000.0f, "%.3f", ImGuiSliderFlags_Logarithmic);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we maybe find a backwards compatible way of dealing with this, that doesn't break current client side code? An override in imconfig.h would be appropiate (included by imgui.h)


if (frame_padding >= 0)
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2((float)frame_padding, (float)frame_padding));
bool clicked = ImGui::ImageButton(icon.mID.c_str(), gui_service->getTextureHandle(icon.getTexture()), size, { 0, 1 }, { 1, 0 }, bg_col, tint_col);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment, for some reason the button doesn't render correct (transparency issue?).

{
ImGui::PushItemWidth(145.0f * mState.mScale);
ImGui::InputFloat2("", &v[0], precision);
const auto format = "%." + std::to_string(precision) + "f";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider turning precision into a constexpr, it's normally known at compile time.

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.

2 participants