Mesa (mesa_7_5_branch): mesa: Add success/ failures return value to _mesa_make_current.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sun May 31 03:29:35 UTC 2009


Module: Mesa
Branch: mesa_7_5_branch
Commit: 29c6c8eb18ace95b9af6dcf34e02c2b8db0ffda8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=29c6c8eb18ace95b9af6dcf34e02c2b8db0ffda8

Author: José Fonseca <jfonseca at vmware.com>
Date:   Sat May 30 12:38:45 2009 -0700

mesa: Add success/failures return value to _mesa_make_current.

---

 src/mesa/main/context.c |    8 +++++---
 src/mesa/main/context.h |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index ec0dc12..884b6ad 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1259,7 +1259,7 @@ initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb)
  * \param drawBuffer  the drawing framebuffer
  * \param readBuffer  the reading framebuffer
  */
-void
+GLboolean
 _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
                     GLframebuffer *readBuffer )
 {
@@ -1272,14 +1272,14 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
       if (!check_compatible(newCtx, drawBuffer)) {
          _mesa_warning(newCtx,
               "MakeCurrent: incompatible visuals for context and drawbuffer");
-         return;
+         return GL_FALSE;
       }
    }
    if (newCtx && readBuffer && newCtx->WinSysReadBuffer != readBuffer) {
       if (!check_compatible(newCtx, readBuffer)) {
          _mesa_warning(newCtx,
               "MakeCurrent: incompatible visuals for context and readbuffer");
-         return;
+         return GL_FALSE;
       }
    }
 
@@ -1384,6 +1384,8 @@ _mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
 	 newCtx->FirstTimeCurrent = GL_FALSE;
       }
    }
+   
+   return GL_TRUE;
 }
 
 
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 5b57d88..6b3e1b2 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -130,7 +130,7 @@ extern void
 _mesa_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
 
 
-extern void
+extern GLboolean
 _mesa_make_current( GLcontext *ctx, GLframebuffer *drawBuffer,
                     GLframebuffer *readBuffer );
 




More information about the mesa-commit mailing list