Check for GL_EXT_texture_format_BGRA8888
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 14 Jan 2011 22:28:21 +0000 (17:28 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 14 Jan 2011 22:39:29 +0000 (17:39 -0500)
compositor/compositor.c

index 8659344..7261dc2 100644 (file)
@@ -1398,6 +1398,7 @@ int
 wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display)
 {
        struct wl_event_loop *loop;
+       const char *extensions;
 
        ec->wl_display = display;
 
@@ -1419,6 +1420,13 @@ wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display)
 
        screenshooter_create(ec);
 
+       extensions = (const char *) glGetString(GL_EXTENSIONS);
+       if (!strstr(extensions, "GL_EXT_texture_format_BGRA8888")) {
+               fprintf(stderr,
+                       "GL_EXT_texture_format_BGRA8888 not available\n");
+               return -1;
+       }
+
        glGenFramebuffers(1, &ec->fbo);
        glBindFramebuffer(GL_FRAMEBUFFER, ec->fbo);
        glActiveTexture(GL_TEXTURE0);