This needs GL_EXT_read_format_bgra.
return -1;
}
+ if (!strstr(extensions, "GL_EXT_read_format_bgra")) {
+ fprintf(stderr, "GL_EXT_read_format_bgra not available\n");
+ return -1;
+ }
+
extensions =
(const char *) eglQueryString(ec->display, EGL_EXTENSIONS);
if (strstr(extensions, "EGL_WL_bind_wayland_display"))
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, output->current->width, output->current->height,
- GL_RGBA, GL_UNSIGNED_BYTE, tmp);
+ GL_BGRA_EXT, GL_UNSIGNED_BYTE, tmp);
d = wl_shm_buffer_get_data(buffer);
s = tmp + stride * (buffer->height - 1);