Open J8-8N opened 1 month ago
Linking to #7797 FYI this function is imgui_internal.h and is experimental and for my own research, I'm not expecting people to be using this at this point.
Hello, yes I'm well aware this is experimental, I'm just raising this narrow issue. I found this in CPP, it has nothing to do with the CSharp bindings.
I spent an hour toying with this and came to the conclusion that the feature is going to be too difficult to fully implement and maintain so I am tempted to remove it. I'm a bit worried that we will stumble on a whole new class of bugs which are going to be difficult to work with.
Yes it's quite user-specific. Could we have the means to save the results of a window rendering (after End()) and then decide ourselves to re-use that cached result after Begin() if we see fit? Then users can decide for themselves if they want to re-render on user interaction, drag, resize, a widget becoming blue, etc. Thank you
if(begin())
if(last_render_was_less_than_one_second_ago and no_user_interaction_since)
end(cached_drawings)
else
text("Hello");
expensive_stuff();
tabs();
table();
end();
cached_drawings = ImGui::previousWindowDrawings();
The current power saving tools are nice but if one window needs a render, they suddenly all do.
I understand ImGui was made to be rendered in game engines and not to make usual CRUD GUIs. I also understand I could cache the expensive calls myself but this would be highly convenient and quickly applicable to any window. And would leave us the opportunity to have some windows at VSync frequency and some at 1Hz (example).
Thank you
Yes it's quite user-specific. Could we have the means to save the results of a window rendering (after End()) and then decide ourselves to re-use that cached result after Begin() if we see fit? Then users can decide for themselves if they want to re-render on user interaction, drag, resize, a widget becoming blue, etc. Thank you
That's exactly equivalent to what we are aiming to do. The problem is figuring out the right rule for re-rendering, which include e.g. parents moving. User is able to give a correct "don't skip this frame" signal but won't be able to tell "definitively can skip this frame" better than the library would.
But there's a large hairy nest of inter-dependency and states which may be used by other subsystems and that are difficult to get right and are going to be incredibly tricky to get from 90% to 100%. I will another afternoon someday having a pass at this but I am not super hopeful.
I understand ImGui was made to be rendered in game engines and not to make usual CRUD GUIs.
Yes.
If you have expensive stuff, cache it or make it less expensive.
Version/Branch of Dear ImGui:
Version 1.91.3-docking
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
CLang 18.1.3 and GCC 13.2.0, Linux Mint 22, x64
Full config/build information:
Details:
Hello, if I clone v1.91.3-docking and edit example_glfw_opengl3/main.cpp to add:
before the "Hello, World!" window Begin() (line 163) then dock the "Hello, World!" window to the Demo window then move my mouse outside that window, the program fails with:
And will fail the same on next launch as it tries to recreate these docked windows from imgui.ini
This is the easiest reproducible example I could think of. It happens with any two windows too.
Thank you very much for the help
main2.cpp.zip
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code: