Skip to content

Commit 5e68ec0

Browse files
authored
Implement revamped RedrawRequested on Windows (#1050)
* Move event loop runner to runner module * Implement new redraw API
1 parent db89e61 commit 5e68ec0

File tree

5 files changed

+467
-429
lines changed

5 files changed

+467
-429
lines changed

examples/window.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ fn main() {
2020
event: WindowEvent::CloseRequested,
2121
window_id,
2222
} if window_id == window.id() => *control_flow = ControlFlow::Exit,
23-
_ => *control_flow = ControlFlow::Wait,
23+
Event::MainEventsCleared => {
24+
window.request_redraw();
25+
}
26+
_ => *control_flow = ControlFlow::Poll,
2427
}
2528
});
2629
}

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
//! match event {
5151
//! Event::MainEventsCleared => {
5252
//! // Application update code.
53-
//!
53+
//!
5454
//! // Queue a RedrawRequested event.
5555
//! window.request_redraw();
5656
//! },

0 commit comments

Comments
 (0)