Add PhysicalDevice::presentation_support
#2562
Merged
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.
This adds a function that abstracts away the platform-specific presentation support calls akin to
Surface::from_window
, allowing you to determine presentation support to the surface of any window of a given event loop. This addresses two issues:Resumed
callback, which makes people think that you have to create the whole device in that callback, when that's not the case. This addition is going to make updating to winit 0.30 easier.PhysicalDevice::surface_support
. This also fixes the issues that the multi-window example was having.PhysicalDevice::surface_support
is essentially only usable if you have a window since right after the creation of the event loop and when the window exists for the app's lifetime. Therefore, I replaced allPhysicalDevice::surface_support
calls in the examples withPhysicalDevice::presentation_support
to promote the better alternative (and for the future when we update to winit 0.30).Unfortunately, this function was not implementable without adding dependencies for X11 libraries on X11 platforms. I added a default feature same as winit does, so the user can disable the dependencies if they e.g. only support Wayland.
Changelog: