mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
Default to vsync for OpenGL rendering
Fixes #3516
(cherry picked from commit fd123b27bd)
This commit is contained in:
parent
772a4455f2
commit
80fae1058f
2 changed files with 16 additions and 0 deletions
|
|
@ -179,6 +179,14 @@ impl OpenGLContext {
|
|||
);
|
||||
}
|
||||
|
||||
// Try to default to vsync and ignore if the driver doesn't support it.
|
||||
surface
|
||||
.set_swap_interval(
|
||||
&context,
|
||||
glutin::surface::SwapInterval::Wait(NonZeroU32::new(1).unwrap()),
|
||||
)
|
||||
.ok();
|
||||
|
||||
Ok((window, Self { context, surface }))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -340,6 +340,14 @@ impl OpenGLSurface {
|
|||
.into());
|
||||
}
|
||||
|
||||
// Try to default to vsync and ignore if the driver doesn't support it.
|
||||
surface
|
||||
.set_swap_interval(
|
||||
&context,
|
||||
glutin::surface::SwapInterval::Wait(NonZeroU32::new(1).unwrap()),
|
||||
)
|
||||
.ok();
|
||||
|
||||
Ok((context, surface))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue