}
}
+/*
+ * fd.o bug #1713: Some rare libGL's have __glXFindDRIScreen defined but do not
+ * export it via glXGetProcAddress. These are not supported anymore, so print
+ * an error message to that effect. - ajax 2004-10-26
+ */
+typedef __DRIscreen *(*PFNGLXFINDDRISCREEN)(__DRInativeDisplay *, int);
+
+static __DRIscreen *glx_find_dri_screen(__DRInativeDisplay *d, int i)
+{
+ PFNGLXFINDDRISCREEN findscreen =
+ (PFNGLXFINDDRISCREEN)glXGetProcAddress("__glXFindDRIScreen");
+
+ if (!findscreen)
+ {
+ __driUtilMessage("glXGetProcAddress(\"__glXFindDRIScreen\") failed!");
+ __driUtilMessage("Your libGL is too old, please upgrade.");
+ return NULL;
+ }
+ else return findscreen(d, i);
+}
/*****************************************************************/
/** \name Visual utility functions */
return GL_FALSE;
}
- pDRIScreen = __glXFindDRIScreen(dpy, scrn);
+ pDRIScreen = glx_find_dri_screen(dpy, scrn);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return GL_FALSE;
return GL_FALSE;
}
- pDRIScreen = __glXFindDRIScreen(dpy, scrn);
+ pDRIScreen = glx_find_dri_screen(dpy, scrn);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return GL_FALSE;
return GL_FALSE;
}
- pDRIScreen = __glXFindDRIScreen(dpy, scrn);
+ pDRIScreen = glx_find_dri_screen(dpy, scrn);
modes = (driCompareGLXAPIVersion( 20040317 ) >= 0)
? gc->driContext.mode
: findConfigMode( dpy, scrn, gc->vid, pDRIScreen );
int renderType,
const int *attrs)
{
- __DRIscreen * const pDRIScreen = __glXFindDRIScreen(dpy, modes->screen);
+ __DRIscreen * const pDRIScreen = glx_find_dri_screen(dpy, modes->screen);
__DRIscreenPrivate *psp;
__DRIdrawablePrivate *pdp;
__DRIscreenPrivate *psp;
void * const shareCtx = (pshare != NULL) ? pshare->driverPrivate : NULL;
- pDRIScreen = __glXFindDRIScreen(dpy, modes->screen);
+ pDRIScreen = glx_find_dri_screen(dpy, modes->screen);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return NULL;
__DRIscreen *pDRIScreen;
const __GLcontextModes *modes;
- pDRIScreen = __glXFindDRIScreen(dpy, vis->screen);
+ pDRIScreen = glx_find_dri_screen(dpy, vis->screen);
if ( (pDRIScreen == NULL) || (pDRIScreen->private == NULL) ) {
/* ERROR!!! */
return NULL;