mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-25 14:17:03 +00:00
[client] opengl: mouse shape updates bypass the draw timeout
This commit is contained in:
parent
c1379a45d2
commit
f7420317f1
@ -82,6 +82,7 @@ struct LGR_OpenGL
|
|||||||
SDL_Rect fpsRect;
|
SDL_Rect fpsRect;
|
||||||
|
|
||||||
bool mouseUpdate;
|
bool mouseUpdate;
|
||||||
|
bool newShape;
|
||||||
uint64_t lastMouseDraw;
|
uint64_t lastMouseDraw;
|
||||||
LG_RendererCursor mouseType;
|
LG_RendererCursor mouseType;
|
||||||
bool mouseVisible;
|
bool mouseVisible;
|
||||||
@ -493,6 +494,7 @@ bool lgr_opengl_on_mouse_shape(void * opaque, const LG_RendererCursor cursor, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->mouseUpdate = true;
|
this->mouseUpdate = true;
|
||||||
|
this->newShape = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -702,10 +704,14 @@ bool lgr_opengl_render(void * opaque)
|
|||||||
if (!this->mouseUpdate)
|
if (!this->mouseUpdate)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// don't update the mouse too fast
|
if (!this->newShape)
|
||||||
const uint64_t delta = nanotime() - this->lastMouseDraw;
|
{
|
||||||
if (delta < 5e6)
|
// don't update the mouse too fast
|
||||||
return true;
|
const uint64_t delta = nanotime() - this->lastMouseDraw;
|
||||||
|
if (delta < 5e6)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
this->newShape = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
glDisable(GL_SCISSOR_TEST);
|
glDisable(GL_SCISSOR_TEST);
|
||||||
|
Loading…
Reference in New Issue
Block a user