[cogl] framebuffer: Checks if glBindFramebuffer() exists when using GLES1



commit bde6979c066c60639f05749a2de73c8554eeecc9
Author: Damien Lespiau <damien lespiau intel com>
Date:   Mon May 16 16:12:00 2011 +0100

    framebuffer: Checks if glBindFramebuffer() exists when using GLES1
    
    With GLES 1, frame buffers are a optional extensions. We need to make
    sure the pointer exist before calling the function and do that by just
    checkout the corresponding feature.

 cogl/cogl-framebuffer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index cfdb265..9dc0fbc 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -1373,7 +1373,9 @@ bind_gl_framebuffer (CoglContext *ctx,
         _cogl_framebuffer_get_winsys (framebuffer);
       winsys->onscreen_bind (COGL_ONSCREEN (framebuffer));
 #endif
-      GE (glBindFramebuffer (target, 0));
+      /* glBindFramebuffer is an an extension with OpenGL ES 1.1 */
+      if (cogl_features_available (COGL_FEATURE_OFFSCREEN))
+        GE (glBindFramebuffer (target, 0));
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]