windows: Update windows-rs
crate and better error handling in DirectWrite
(#12818)
- Update `windows-rs` from `0.56` to `0.57` - Use the newly introduced `Owned` struct in `0.57` to handle the RAII stuff of `HANDLE` - Better error handling in `DirectWrite` Release Notes: - N/A
This commit is contained in:
parent
1413b5af93
commit
4cb45e63f4
6 changed files with 116 additions and 167 deletions
|
@ -162,16 +162,11 @@ impl Platform for WindowsPlatform {
|
|||
|
||||
fn run(&self, on_finish_launching: Box<dyn 'static + FnOnce()>) {
|
||||
on_finish_launching();
|
||||
let vsync_event = create_event().unwrap();
|
||||
begin_vsync(vsync_event.to_raw());
|
||||
let vsync_event = unsafe { Owned::new(CreateEventW(None, false, false, None).unwrap()) };
|
||||
begin_vsync(*vsync_event);
|
||||
'a: loop {
|
||||
let wait_result = unsafe {
|
||||
MsgWaitForMultipleObjects(
|
||||
Some(&[vsync_event.to_raw()]),
|
||||
false,
|
||||
INFINITE,
|
||||
QS_ALLINPUT,
|
||||
)
|
||||
MsgWaitForMultipleObjects(Some(&[*vsync_event]), false, INFINITE, QS_ALLINPUT)
|
||||
};
|
||||
|
||||
match wait_result {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue