Skip to content
Snippets Groups Projects
Commit dec9e8d9 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Limit GUI redraw rate

parent 4d2cee76
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
Pipeline #28513 failed
......@@ -106,7 +106,7 @@ void FTLGui::mainloop() {
screen_->setVisible(true);
screen_->drawAll();
//float last_draw_time = 0.0f;
float last_draw_time = 0.0f;
while (ftl::running) {
if (!screen_->visible()) {
......@@ -117,8 +117,8 @@ void FTLGui::mainloop() {
ftl::running = false;
}
else {
//float now = float(glfwGetTime());
//float delta = now - last_draw_time;
float now = float(glfwGetTime());
float delta = now - last_draw_time;
// Generate poses and render and virtual frame here
// at full FPS (25 without VR and 90 with VR currently)
......@@ -127,10 +127,10 @@ void FTLGui::mainloop() {
io_->feed()->render();
// Only draw the GUI at 25fps
//if (delta >= 0.04f) {
// last_draw_time = now;
if (delta >= 0.04f) {
last_draw_time = now;
screen_->drawAll();
//}
}
}
// Wait for mouse/keyboard or empty refresh events
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment