Skip to content

Commit 984ca8e

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 f03bca6 commit 984ca8e

File tree

4 files changed

+0
-8
lines changed

4 files changed

+0
-8
lines changed

examples/features/src/framework.rs

-2
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

-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
9898
config.width = new_size.width.max(1);
9999
config.height = new_size.height.max(1);
100100
surface.configure(&device, &config);
101-
// On macos the window needs to be redrawn manually after resizing
102-
window.request_redraw();
103101
}
104102
WindowEvent::RedrawRequested => {
105103
let frame = surface

examples/features/src/hello_windows/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ async fn run(event_loop: EventLoop<()>, viewports: Vec<(Arc<Window>, wgpu::Color
9898
// Recreate the swap chain with the new size
9999
if let Some(viewport) = viewports.get_mut(&window_id) {
100100
viewport.resize(&device, new_size);
101-
// On macos the window needs to be redrawn manually after resizing
102-
viewport.desc.window.request_redraw();
103101
}
104102
}
105103
WindowEvent::RedrawRequested => {

examples/features/src/uniform_values/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ impl WgpuContext {
210210
self.surface_config.width = new_size.width;
211211
self.surface_config.height = new_size.height;
212212
self.surface.configure(&self.device, &self.surface_config);
213-
self.window.request_redraw();
214213
}
215214
}
216215

@@ -278,7 +277,6 @@ async fn run(event_loop: EventLoop<()>, window: Arc<Window>) {
278277
WindowEvent::Resized(new_size) => {
279278
let wgpu_context_mut = wgpu_context.as_mut().unwrap();
280279
wgpu_context_mut.resize(new_size);
281-
wgpu_context_mut.window.request_redraw();
282280
}
283281
WindowEvent::RedrawRequested => {
284282
let wgpu_context_ref = wgpu_context.as_ref().unwrap();

0 commit comments

Comments
 (0)