Skip to content

Commit ff90830

Browse files
committed
[examples] Do not request redraw on resize
This is no longer necessary, since Winit can now properly issue redraw events on resize.
1 parent b2baf75 commit ff90830

File tree

4 files changed

+0
-8
lines changed

4 files changed

+0
-8
lines changed

examples/features/src/framework.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,6 @@ async fn start<E: Example>(title: &str) {
391391
&context.device,
392392
&context.queue,
393393
);
394-
395-
window_loop.window.request_redraw();
396394
}
397395
WindowEvent::KeyboardInput {
398396
event:

examples/features/src/hello_triangle/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
100100
config.width = new_size.width.max(1);
101101
config.height = new_size.height.max(1);
102102
surface.configure(&device, &config);
103-
// On macos the window needs to be redrawn manually after resizing
104-
window.request_redraw();
105103
}
106104
WindowEvent::RedrawRequested => {
107105
let frame = surface

examples/features/src/hello_windows/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ async fn run(event_loop: EventLoop<()>, viewports: Vec<(Arc<Window>, wgpu::Color
100100
// Recreate the swap chain with the new size
101101
if let Some(viewport) = viewports.get_mut(&window_id) {
102102
viewport.resize(&device, new_size);
103-
// On macos the window needs to be redrawn manually after resizing
104-
viewport.desc.window.request_redraw();
105103
}
106104
}
107105
WindowEvent::RedrawRequested => {

examples/features/src/uniform_values/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ impl WgpuContext {
212212
self.surface_config.width = new_size.width;
213213
self.surface_config.height = new_size.height;
214214
self.surface.configure(&self.device, &self.surface_config);
215-
self.window.request_redraw();
216215
}
217216
}
218217

@@ -280,7 +279,6 @@ async fn run(event_loop: EventLoop<()>, window: Arc<Window>) {
280279
WindowEvent::Resized(new_size) => {
281280
let wgpu_context_mut = wgpu_context.as_mut().unwrap();
282281
wgpu_context_mut.resize(new_size);
283-
wgpu_context_mut.window.request_redraw();
284282
}
285283
WindowEvent::RedrawRequested => {
286284
let wgpu_context_ref = wgpu_context.as_ref().unwrap();

0 commit comments

Comments
 (0)