mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 22:41:07 +01:00
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:
1 file changed
+4
@@ -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],
|
||||
|
||||
Reference in new issue
Block a user