|
TachyonUI 1.1.0
High-performance UI for building tools.
|
Whether frames are locked to the vsync, told by how long presenting them waited. More...
#include <gui_core/frame/gui_frame_clock.h>
Public Member Functions | |
| void | NotePresent (double presentSeconds, float refreshHz) |
| After presenting a frame: the seconds present took; refreshHz 0 when unknown, which counts as not waiting. | |
| bool | IsLocked () const |
Static Public Attributes | |
| static constexpr int | kFramesToSwitch = 3 |
| Presents in a row that waited, or didn't, before the lock changes. | |
| static constexpr double | kWaitedShare = 0.1 |
| The share of a refresh period present must wait to count as a vsync wait. | |
Whether frames are locked to the vsync, told by how long presenting them waited.
A window the driver flips on the vsync waits most of a period in present; one the OS compositor draws (an unfocused window on Windows, a mailbox swapchain) returns at once, and its frames are shown on whichever vsync the compositor picks. FrameClock snaps to the refresh only while locked. It switches after kFramesToSwitch presents in a row say so, so one long frame, which leaves present nothing to wait for, doesn't unlock it.
| void tachyon::VsyncLock::NotePresent | ( | double | presentSeconds, |
| float | refreshHz ) |
After presenting a frame: the seconds present took; refreshHz 0 when unknown, which counts as not waiting.
|
inline |
|
staticconstexpr |
Presents in a row that waited, or didn't, before the lock changes.
|
staticconstexpr |
The share of a refresh period present must wait to count as a vsync wait.