| 17 | } |
| 18 | |
| 19 | void FramerateManager::configure(vili::node& config) |
| 20 | { |
| 21 | if (!config["framerateTarget"].is_null()) |
| 22 | { |
| 23 | m_limitFramerate = true; |
| 24 | m_framerateTarget = config["framerateTarget"]; |
| 25 | } |
| 26 | if (!config["vsync"].is_null()) |
| 27 | { |
| 28 | m_vsyncEnabled = config["vsync"]; |
| 29 | } |
| 30 | if (!config["syncUpdateToRender"].is_null()) |
| 31 | { |
| 32 | m_syncUpdateRender = config["syncUpdateToRender"]; |
| 33 | } |
| 34 | m_reqFramerateInterval = 1.0 / static_cast<double>(m_framerateTarget); |
| 35 | Debug::Log->info("Framerate parameters : {} FPS {}, V-sync {}, Update Lock {}", |
| 36 | m_framerateTarget, (m_limitFramerate) ? "capped" : "uncapped", |
| 37 | (m_vsyncEnabled) ? "enabled" : "disabled", |
| 38 | (m_syncUpdateRender) ? "enabled" : "disabled"); |
| 39 | |
| 40 | m_window.setVerticalSyncEnabled(m_vsyncEnabled); |
| 41 | } |
| 42 | |
| 43 | void FramerateManager::update() |
| 44 | { |
nothing calls this directly
no test coverage detected