imgui icon indicating copy to clipboard operation
imgui copied to clipboard

Examples: DirectX9: Force a redraw in the resize loop

Open learn-more opened this issue 1 year ago • 3 comments

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

learn-more avatar May 26 '23 15:05 learn-more

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 96ab68eee0 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 f43c6ea6a4c1fb7709ac454132f95620f2c416ba and found a better solution for Emscripten (better solution ea39841fcd5338dc0b041c24ef81613d95b066e7).

The change also seemingly defeat the purpose of 031e152d2 (#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?

ocornut avatar May 30 '23 08:05 ocornut

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?

learn-more avatar May 31 '23 11:05 learn-more

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

ocornut avatar May 31 '23 12:05 ocornut