2 different sync apis with differetn ext's. fix.

SVN revision: 57569
This commit is contained in:
Carsten Haitzler 2011-03-08 11:20:49 +00:00
parent 63638f7393
commit e4b877f45d
2 changed files with 23 additions and 8 deletions

View File

@ -139,3 +139,9 @@
2011-03-07 Mike Blumenkrantz
* Fix segv when trying to set gl viewpoint with NULL ctx
2011-03-08 Carsten Haitzler (The Rasterman)
* Fix problem with different x vsync api between SGI and EXT flavor
as they have the same base name, but different prototypes.

View File

@ -66,7 +66,8 @@ int (*glsym_glXWaitVideoSync) (int a, int b, unsigned int *c) = NULL;
XID (*glsym_glXCreatePixmap) (Display *a, void *b, Pixmap c, const int *d) = NULL;
void (*glsym_glXDestroyPixmap) (Display *a, XID b) = NULL;
void (*glsym_glXQueryDrawable) (Display *a, XID b, int c, unsigned int *d) = NULL;
void (*glsym_glxSwapInterval) (int a) = NULL;
int (*glsym_glxSwapIntervalSGI) (int a) = NULL;
void (*glsym_glxSwapIntervalEXT) (Display *s, GLXDrawable b, int c) = NULL;
#endif
static void
@ -140,10 +141,9 @@ _sym_init(void)
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableEXT", glsym_func_void);
FINDSYM(glsym_glXQueryDrawable, "glXQueryDrawableARB", glsym_func_void);
FINDSYM(glsym_glxSwapInterval, "glxSwapInterval", glsym_func_void);
FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalEXT", glsym_func_void);
FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalARB", glsym_func_void);
FINDSYM(glsym_glxSwapInterval, "glxSwapIntervalSGI", glsym_func_void);
FINDSYM(glsym_glxSwapIntervalSGI, "glxSwapIntervalSGI", glsym_func_int);
FINDSYM(glsym_glxSwapIntervalEXT, "glxSwapIntervalEXT", glsym_func_void);
#endif
}
@ -668,12 +668,21 @@ eng_output_flush(void *data)
#ifdef VSYNC_TO_SCREEN
if ((re->info->vsync)/* || (1)*/)
{
if (glsym_glxSwapInterval)
if (glsym_glxSwapIntervalEXT)
{
if (!re->vsync)
{
if (re->info->vsync) glsym_glxSwapInterval(1);
else glsym_glxSwapInterval(0);
if (re->info->vsync) glsym_glxSwapIntervalEXT(re->win->disp, re->win->win, 1);
else glsym_glxSwapIntervalEXT(re->win->disp, re->win->win, 0);
re->vsync = 1;
}
}
if (glsym_glxSwapIntervalSGI)
{
if (!re->vsync)
{
if (re->info->vsync) glsym_glxSwapIntervalSGI(1);
else glsym_glxSwapIntervalSGI(0);
re->vsync = 1;
}
}