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

Examples: DirectX9: Force a redraw in the resize loop #6461

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

learn-more
Copy link
Contributor

In the Windows examples, currently Dear ImGui does not redraw while resizing the window.
This is caused by the DispatchMessage function running it's own message loop as long as the user is resizing.

There are various tickets about this, most notably: #5274

This PR shows a possible workaround, with the goal of discussing this direction.

Before:

before

After:

after

@ocornut
Copy link
Owner

ocornut commented May 30, 2023

Hello,

I agree that ideally we would provide a demo of this, but I have an issue with the restructuring using a main loop function.

A few months ago for the purpose of unifying Emscripten building I committed 96ab68e with did a similar thing, and then quickly realized it created a big hurdle to use the example app as quick test-beds (for pretty much anything), ended up reverting with f43c6ea and found a better solution for Emscripten (better solution ea39841).

The change also seemingly defeat the purpose of 031e152 (#6374) and we would need to verify if e.g. the additional swap helps drivers frees their buffer.

I'm not sure there is a solution other than better documenting this possibility: maybe add comments in WM handler?

@learn-more
Copy link
Contributor Author

Hello,

I agree that ideally we would provide a demo of this, but I have an issue with the restructuring using a main loop function.

A few months ago for the purpose of unifying Emscripten building I committed 96ab68e with did a similar thing, and then quickly realized it created a big hurdle to use the example app as quick test-beds (for pretty much anything), ended up reverting with f43c6ea and found a better solution for Emscripten (better solution ea39841).

The change also seemingly defeat the purpose of 031e152 (#6374) and we would need to verify if e.g. the additional swap helps drivers frees their buffer.

I'm not sure there is a solution other than better documenting this possibility: maybe add comments in WM handler?

Thanks for your detailed feedback!
I'll take another stab at this with your comments in mind.
Are you ok with keeping this open until then, or would you prefer to close this and I'll open a new PR with another solution?

@ocornut
Copy link
Owner

ocornut commented May 31, 2023

Best to keep this open and centralized, it's fine.

@ocornut ocornut changed the title Examples: Dx9: Force a redraw in the resize loop Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants