From 2d087480b4b1207c058efcccc9a72faedcea4651 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Jun 2006 23:04:41 +0000 Subject: [PATCH] GLX_BAD_CONTEXT checks in video-sync functions --- src/mesa/drivers/x11/glxapi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c index 7ce607a69c0..4f3dca8f484 100644 --- a/src/mesa/drivers/x11/glxapi.c +++ b/src/mesa/drivers/x11/glxapi.c @@ -588,8 +588,8 @@ glXGetVideoSyncSGI(unsigned int *count) struct _glxapi_table *t; Display *dpy = glXGetCurrentDisplay(); GET_DISPATCH(dpy, t); - if (!t) - return 0; + if (!t || !glXGetCurrentContext()) + return GLX_BAD_CONTEXT; return (t->GetVideoSyncSGI)(count); } @@ -599,8 +599,8 @@ glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) struct _glxapi_table *t; Display *dpy = glXGetCurrentDisplay(); GET_DISPATCH(dpy, t); - if (!t) - return 0; + if (!t || !glXGetCurrentContext()) + return GLX_BAD_CONTEXT; return (t->WaitVideoSyncSGI)(divisor, remainder, count); } @@ -614,7 +614,7 @@ glXMakeCurrentReadSGI(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXConte struct _glxapi_table *t; GET_DISPATCH(dpy, t); if (!t) - return 0; + return False; return (t->MakeCurrentReadSGI)(dpy, draw, read, ctx); } -- 2.30.2