Set EGL swap interval to 0
This commit is contained in:
parent
66ca44bb4e
commit
42f33c1b0e
1 changed files with 9 additions and 1 deletions
10
wayland.c
10
wayland.c
|
|
@ -251,11 +251,19 @@ int main()
|
||||||
wl_region_add(region, 0, 0, 480, 360);
|
wl_region_add(region, 0, 0, 480, 360);
|
||||||
wl_surface_set_opaque_region(surface, region);
|
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
|
// Main event loop
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
wl_display_dispatch_pending(display);
|
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);
|
glClearColor(0.5, 0.3, 0.0, 1.0);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue