Add comments to framework.rs explaining animation loop and VSync (#9635)

Co-authored-by: theoxfaber <shankmukhkiransagar@gmail.com>
Co-authored-by: Shanmukh kiran Sagar <shanmukhkiransagar@Shanmukhs-MacBook-Air.local>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-06-15 17:40:32 +00:00
1 parent 16e4ce99ba
commit 273dcf882e
1 file changed
+4
+4
View File
@@ -560,6 +560,9 @@ impl<E: Example> ApplicationHandler<AppAction> for App<E> {
context.queue.present(frame);
}
// Request another redraw to keep the animation loop running.
// Examples that only render once (like hello_triangle) omit
// this call so the event loop can rest between frames.
if let Some(window) = &self.window {
window.request_redraw();
}
@@ -700,6 +703,7 @@ impl<E: Example + wgpu::WasmNotSendSync> From<ExampleTestParams<E>>
width: params.width,
height: params.height,
desired_maximum_frame_latency: 2,
// Fifo corresponds to traditional VSync. It's supported everywhere.
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![format],