Use improved RedrawRequested API in iced_winit
This commit is contained in:
parent
ae585eb9cb
commit
2fe01a0b1e
2 changed files with 8 additions and 8 deletions
|
|
@ -9,5 +9,5 @@ repository = "https://github.com/hecrj/iced"
|
|||
|
||||
[dependencies]
|
||||
iced_native = { version = "0.1.0-alpha", path = "../native" }
|
||||
winit = "0.20.0-alpha3"
|
||||
winit = { version = "0.20.0-alpha3", git = "https://github.com/hecrj/winit", branch = "redraw-requested-2.0" }
|
||||
log = "0.4"
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ pub trait Application {
|
|||
window.request_redraw();
|
||||
|
||||
event_loop.run(move |event, _, control_flow| match event {
|
||||
event::Event::EventsCleared => {
|
||||
event::Event::MainEventsCleared => {
|
||||
// TODO: We should be able to keep a user interface alive
|
||||
// between events once we remove state references.
|
||||
//
|
||||
|
|
@ -90,16 +90,16 @@ pub trait Application {
|
|||
|
||||
window.request_redraw();
|
||||
}
|
||||
event::Event::RedrawRequested(_) => {
|
||||
renderer.draw(&mut target, &primitive);
|
||||
|
||||
// TODO: Handle animations!
|
||||
// Maybe we can use `ControlFlow::WaitUntil` for this.
|
||||
}
|
||||
event::Event::WindowEvent {
|
||||
event: window_event,
|
||||
..
|
||||
} => match window_event {
|
||||
WindowEvent::RedrawRequested => {
|
||||
renderer.draw(&mut target, &primitive);
|
||||
|
||||
// TODO: Handle animations!
|
||||
// Maybe we can use `ControlFlow::WaitUntil` for this.
|
||||
}
|
||||
WindowEvent::CursorMoved { position, .. } => {
|
||||
let physical_position =
|
||||
position.to_physical(window.hidpi_factor());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue