Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGuiWindowFlags_UserDrawnOverlappingDecorators #8347

Open
wants to merge 2 commits into
base: docking
Choose a base branch
from

Conversation

mihaly-sisak
Copy link

@mihaly-sisak mihaly-sisak commented Jan 25, 2025

Screenshot_2025-01-25_15-42-46

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 as ImGui::Image() or ImGui::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?

@mihaly-sisak
Copy link
Author

Maybe instead of "overlapping decorators" it could be "overdrawn decorators".

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.

1 participant