Implement changes to RedrawRequested event (#1062)
* Implement changes to `RedrawRequested` event Implements the changes described in #1041 for the X11 platform and for platform-independent public-facing code. * Fix `request_redraw` example * Fix examples in lib docs * Only issue `RedrawRequested` on final `Expose` event
This commit is contained in:
parent
c10c820311
commit
0c151f9fb3
7 changed files with 67 additions and 37 deletions
|
|
@ -48,19 +48,16 @@
|
|||
//!
|
||||
//! event_loop.run(move |event, _, control_flow| {
|
||||
//! match event {
|
||||
//! Event::EventsCleared => {
|
||||
//! Event::MainEventsCleared => {
|
||||
//! // Application update code.
|
||||
//!
|
||||
//! // Queue a RedrawRequested event.
|
||||
//! window.request_redraw();
|
||||
//! },
|
||||
//! Event::WindowEvent {
|
||||
//! event: WindowEvent::RedrawRequested,
|
||||
//! ..
|
||||
//! } => {
|
||||
//! Event::RedrawRequested(_) => {
|
||||
//! // Redraw the application.
|
||||
//! //
|
||||
//! // It's preferrable to render in this event rather than in EventsCleared, since
|
||||
//! // It's preferrable to render in this event rather than in MainEventsCleared, since
|
||||
//! // rendering in here allows the program to gracefully handle redraws requested
|
||||
//! // by the OS.
|
||||
//! },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue