You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a D3D11 sample app with the windows crate and came across a minor inconvenience: D3D11_CLEAR_FLAG does not implement bit ops, like e.g. D3D11_CREATE_DEVICE_FLAG does, so instead of writing
let clear_flags = D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL;
I need to write
let clear_flags = D3D11_CLEAR_DEPTH.0 | D3D11_CLEAR_STENCIL.0;
Later I want to call ID3D11DeviceContext::ClearDepthStencilView, but the underlying type of clear_flags is i32 while the API expects a u32, so I need to add another cast so it compiles again:
let dsv = ...
let context = ...context.ClearDepthStencilView(&dsv, clear_flags asu32,1.0,0);
I think this could be fixed by using u32 as the underlying type for D3D11_CLEAR_FLAG, like D3D11_CREATE_DEVICE_FLAG does.
Which crate is this about?
windows
Crate version
0.43.0
Summary
I'm writing a D3D11 sample app with the windows crate and came across a minor inconvenience:
D3D11_CLEAR_FLAG
does not implement bit ops, like e.g.D3D11_CREATE_DEVICE_FLAG
does, so instead of writingI need to write
Later I want to call
ID3D11DeviceContext::ClearDepthStencilView
, but the underlying type ofclear_flags
isi32
while the API expects au32
, so I need to add another cast so it compiles again:I think this could be fixed by using u32 as the underlying type for
D3D11_CLEAR_FLAG
, likeD3D11_CREATE_DEVICE_FLAG
does.Toolchain version/configuration
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\waved.rustup
stable-x86_64-pc-windows-msvc (default)
rustc 1.65.0 (897e37553 2022-11-02)
Reproducible example
No response
Crate manifest
No response
Expected behavior
No response
Actual behavior
No response
Additional comments
No response
The text was updated successfully, but these errors were encountered: