Implement WinRT support in SDL2 raw-window-handle shim #1183
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.
Now that #1182 is merged the crate is up to date with the latest
raw-window-handle
release. This release contains the results of my PR from February which adds support for WinRT (UWP) to the crate.raw-window-handle
now exposes a WinRt variant which contains an opaque c_void pointer to what is expected to be a CoreWindow*. SDL2 provides the same mechanism with theSDL_SYSWM_WINRT
enum variant and thewinrt
field onSDL_SysWMinfo
, which is what I modeled the WinRt variant inraw-window-handle
after.As a result, this PR includes the additions necessary to shim the CoreWindow pointer from SDL2 to
raw-window-handle
, allowing the use of this crate on UWP.The changes simply adds the required match branch to output the
RawWindowHandle::WinRt
variant, as well as modifying the union definition so we can shim it from SDL2. SDL2 already handles the UWP pain for us.Here's
egui
rendered with DirectX 12 in a UWP app on Windows 10.I would include it running on my Xbox Series S too if I hadn't loaned it to someone.
The source code for my implementation of the UWP app is here https://github.com/nathanvoglsam/aleph.