Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Switch to flip + hwnd hybrid approach #21

Merged
merged 7 commits into from
Apr 19, 2018
Merged

Switch to flip + hwnd hybrid approach #21

merged 7 commits into from
Apr 19, 2018

Conversation

raphlinus
Copy link
Member

This is an attempt to address #17, merging the flip + hwnd hybrid approach discussed in #19 (and thanks to the testers).

The hybrid approach only works on Windows 8.1 and up, so we use optional functions to set up composition and the swap chain. On Windows 7, all presentation is with the hwnd approach.

A couple flaws - the menubar doesn't draw at all (when
WS_EX_NOREDIRECTIONBITMAP is set). Also resizing is not smooth.
Use Present(0) and DwmFlush logic to resize more smoothly.
Performance is pretty bad with integrated adapter on my hardware,
so always choose discrete.
Make the present strategy a settable parameter, for experimentation.
Use DXGI flip in the normal case, hwnd for resize.
Some of the functions needed for flip mode are unavailable in Windows
7, so load them optionally.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant