ImGuiWindowFlags_UserDrawnOverlappingDecorators #8347
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If I want to render to an ImGui window with OpenGL, the solution I found on the net was to do an off-screen render with sizes obtained with
ImGui::GetContentRegionAvail()
, then add the result of that to the ImGui window either asImGui::Image()
orImGui::GetWindowDrawList()->AddImage()
.The problem with this approach is that the image overlaps the docking unhide tab bar (small triangle in the corner) and resize grips, since they are being drawn during
Begin()
.This PR adds a new
ImGuiWindowFlags_UserDrawnOverlappingDecorators
. The overlapping decorators are not drawn, but their coordinates are being stored in a new struct,window->Decorators
. These are drawn when the user calls a new function,ImGui::DrawOverlappingDecorators()
. This way the user can order the drawing of the overlapping decorators, so they are visible in the final render.I tried to match the coding style as close as I was able to. If my approach to this problem is flawed please point me to the right direction. I tried to give sane names to the variables but I feel like they sound forced. Maybe
ImGuiWindowFlags_UserOrderedOverlappingDecorators
would be better, since the user does not draw just order them?