rem: if (__GL_SYNC_TO_VBLANK == -1) { char const* var = getenv("__GL_SYNC_TO_VBLANK");  __GL_SYNC_TO_VBLANK = var != NULL ? atoi(var) : 0; } else if (__GL_SYNC_TO_VBLANK != 0) {
add: if (swapbuffer_syncs_to_vblank()) {
context: bool glgfx_monitor_waittof(struct glgfx_monitor* monitor) {  if (__GL_SYNC_TO_VBLANK == -1) {    char const* var = getenv("__GL_SYNC_TO_VBLANK");          __GL_SYNC_TO_VBLANK = var != NULL ? atoi(var) : 0;  }  else if (__GL_SYNC_TO_VBLANK != 0) {    // Return immediately, since glgfx_monitor_swapbuffers() will    // sleep for us.    return false;  }  if (monitor->have_GLX_SGI_video_sync) {    GLuint frame_count;    if (glXGetVideoSyncSGI(&frame_count) != 0) {      return false;    }    if (glXWaitVideoSyncSGI(1, 0, &frame_count) != 0) {      return false;    }    return true;  }  else {    bool rc = true;    pthread_mutex_lock(&glgfx_mutex);    if (pthread_cond_wait(&monitor->vsync_cond, &glgfx_mutex) != 0) {      rc = false;    }    pthread_mutex_unlock(&glgfx_mutex);        return true;  }}