diff --git a/wayland.c b/wayland.c index 8133c47..6e8c4ec 100644 --- a/wayland.c +++ b/wayland.c @@ -251,11 +251,19 @@ int main() wl_region_add(region, 0, 0, 480, 360); wl_surface_set_opaque_region(surface, region); + /* NOTE: It would seem that having a non-zero swap interval can hang the Mesa driver forever, according to this SDL GH issue: + https://github.com/libsdl-org/SDL/issues/4335#issuecomment-829789881 + */ + if (eglSwapInterval(egl_display, 0) != EGL_TRUE) + fprintf(stderr, "Could not set EGL swap interval\n"); + + int framecount = 0; + // Main event loop while (1) { wl_display_dispatch_pending(display); - fprintf(stdout, "Dispatching event...\n"); + fprintf(stdout, "Frame %d\n", framecount++); glClearColor(0.5, 0.3, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); glFlush();