-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
This is a common concept in e.g. browsers to have non blocking frame scheduling at the display refresh rate.
It seems like it's possible on all desktop platforms and the web. For the rest we may indicate that vsync source is not supported.
The way to integrate it would be to add WindowEvent::Frame
which must be send when the new frame is ready to be drawn. That will come from the compositor directly and the users must request those event via Window::request_frame() -> Result<()>
, where the result will indicate that the event can't be scheduled due to reasons.
The Api that should be used for that on platform are the following.
X11 - Xpresent
macOS - DisplayLink
Wayland - frame callbacks
Windows - DWM get composition timings + a timer.
Web - request animation frame.
The Api is essential for Wayland clients, since they must not rely on vsync from the graphics Api.