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

Migrate core gpu-allocator crate and basic examples to windows-rs #107

Merged
merged 4 commits into from
May 19, 2022

Conversation

MarijnS95
Copy link
Member

@MarijnS95 MarijnS95 commented Mar 24, 2022

Depends on #106
Fixes #62

As has long been planned and discussed we'd like to get rid of the ancient and barely maintained winapi crate, in favour of something more modern: windows-rs is actively developed and maintained by Microsoft themselves, and generated out of header metadata rather than written by hand. Besides, it provides a more sophisticated and safer API for dealing with objects (abstracting away return types behind Result, hiding COM lifetime management, etc).

The choice for the "heavier" windows crate over windows-sys is fairly obvious: DirectX APIs are built on the COM object model which is completely unsupported in windows-sys making us unable to perform any method calls. Besides, the windows-sys crate does very little to make the API more convenient nor safer to use, effectively taking us a step back from winapi instead of a step forward.

@MarijnS95 MarijnS95 force-pushed the windows-rs branch 3 times, most recently from 8f9595d to 6bb9b27 Compare March 25, 2022 09:05
@MarijnS95 MarijnS95 force-pushed the windows-rs branch 2 times, most recently from 35e04bf to eded1e6 Compare May 18, 2022 14:50
src/d3d12/mod.rs Outdated Show resolved Hide resolved
MarijnS95 and others added 3 commits May 18, 2022 17:05
As has long been planned and discussed we'd like to get rid of the
ancient and barely maintained `winapi` crate, in favour of something
more modern: `windows-rs` is actively developed and maintained by
Microsoft themselves, and generated out of header metadata rather than
written by hand.  Besides, it provides a more sophisticated and safer
API for dealing with objects (abstracting away return types behind
`Result`, hiding COM lifetime management, etc).

The choice for the "heavier" `windows` crate over `windows-sys` is
fairly obvious: DirectX APIs are built on the COM object model which is
completely unsupported in `windows-sys` making us unable to perform any
method calls.  Besides, the `windows-sys` crate does very little to make
the API more convenient nor safer to use, effectively taking us a step
back from `winapi` instead of a step forward.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch over to windows-rs
2 participants