Set EGL swap interval to 0

This commit is contained in:
Phireh 2024-11-18 16:06:15 +01:00
commit 42f33c1b0e

View file

@ -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();