iTime now starts at 0

This commit is contained in:
Rakarake 2026-02-24 15:23:13 +01:00
parent 44ba0468d9
commit c3c39a77cd

View file

@ -157,10 +157,16 @@ void egl_init_surface(struct client_state *state, struct surface *surface) {
static const struct wl_callback_listener wl_surface_frame_listener; static const struct wl_callback_listener wl_surface_frame_listener;
bool first_frame_done = false;
uint32_t time_start;
static void static void
wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) { wl_surface_frame_done(void *data, struct wl_callback *cb, uint32_t time) {
if (!first_frame_done) {
first_frame_done = true;
time_start = time;
}
struct surface *surface = data; struct surface *surface = data;
surface->time = time; surface->time = time - time_start;
/* Destroy this callback */ /* Destroy this callback */
wl_callback_destroy(cb); wl_callback_destroy(cb);