Fixed glBindFramebuffer(0) issue for Direct Rendering
authorSung Park <sungwoo@gmail.com>
Fri, 24 Feb 2012 08:13:48 +0000 (08:13 +0000)
committerSung Park <sungwoo@gmail.com>
Fri, 24 Feb 2012 08:13:48 +0000 (08:13 +0000)
optimization.  current_fbo wasn't being set to 0
so the above case wasn't being handled properly.

SVN revision: 68392

legacy/evas/src/modules/engines/gl_x11/evas_engine.c

index 5edbb19..94424b2 100644 (file)
@@ -3514,24 +3514,27 @@ evgl_glBindFramebuffer(GLenum target, GLuint framebuffer)
 {
    Render_Engine_GL_Context *ctx = current_evgl_ctx;
 
+   if (!ctx) 
+     {
+        ERR("No current context set.");
+        return;
+     }
+
    // Take care of BindFramebuffer 0 issue
    if (framebuffer==0)
      {
         if (gl_direct_enabled)
            glBindFramebuffer(target, 0);
-        else if (ctx)
-          {
-             glBindFramebuffer(target, ctx->context_fbo);
-             ctx->current_fbo = 0;
-          }
+        else 
+           glBindFramebuffer(target, ctx->context_fbo);
+        ctx->current_fbo = 0;
      }
    else
      {
         glBindFramebuffer(target, framebuffer);
 
         // Save this for restore when doing make current
-        if (ctx)
-           ctx->current_fbo = framebuffer;
+        ctx->current_fbo = framebuffer;
      }
 }