~ trying to update refresh rate

This commit is contained in:
Johannes Theiner 2020-01-08 16:21:50 +01:00
parent b6c91e8373
commit d8ea12e567
1 changed files with 7 additions and 1 deletions

View File

@ -39,6 +39,9 @@ int GUI_run(int argc, char **argv) {
vkvm::registerEvent(vkvm::EventType::UpdateControlRegisters, [image, window, status]() {
int newRedrawInterval = vkvm::getRedrawInterval();
if(newRedrawInterval != redrawInterval) {
/*if(redrawInterval == -1 && newRedrawInterval != -1) {
refreshCallback(image);
}*/
redrawInterval = newRedrawInterval;
}
@ -66,7 +69,10 @@ static void refreshCallback(void * pointer) {
auto *image = static_cast<Image*>(pointer);
image->getPixels();
Fl::repeat_timeout((double) redrawInterval / 1000, redrawCallback, image);
if(redrawInterval != -1) {
Fl::repeat_timeout((double) redrawInterval / 1000, redrawCallback, image);
}
}
static void redrawCallback(void * pointer) {