[client] ds: add optional method signalNextFrame(LGEvent)

This method takes an LGEvent and signals it when the next frame should be
rendered in time for the next vblank.

We will be using this to render imgui at screen refresh rate, but this could
potentially be used later to implement a better form of vsync for supported
display servers.

This must be invoked before swapping buffers.
This commit is contained in:
Quantum 2021-07-31 03:58:53 -04:00 committed by Geoffrey McRae
parent be9a16e8a2
commit 3043296e52

View file

@ -101,6 +101,8 @@ typedef void (* LG_ClipboardReplyFn)(void * opaque, const LG_ClipboardData type,
typedef struct LG_DSGLContext
* LG_DSGLContext;
typedef struct LGEvent LGEvent;
struct LG_DisplayServerOps
{
/* called before options are parsed, useful for registering options */
@ -147,6 +149,12 @@ struct LG_DisplayServerOps
void (*glSwapBuffers)(void);
#endif
/* Signals event when the next frame should be rendered in time for the next vblank.
* This must be invoked on the render thread before swapping buffers.
* If used, the render thread MUST wait for event before rendering the next frame.
* This is optional and a display server may choose to not implement it. */
void (*signalNextFrame)(LGEvent * event);
/* dm specific cursor implementations */
void (*guestPointerUpdated)(double x, double y, double localX, double localY);
void (*setPointer)(LG_DSPointer pointer);