typedef struct __DRIframebufferRec __DRIframebuffer;
typedef struct __DRIversionRec __DRIversion;
typedef struct __DRIinterfaceMethodsRec __DRIinterfaceMethods;
+
+typedef struct __DRIextensionRec __DRIextension;
/*@}*/
+/**
+ * Extension struct. Drivers 'inherit' from this struct by embedding
+ * it as the first element in the extension struct. The
+ * __DRIscreen::getExtensions entry point will return a list of these
+ * structs and the loader can use the extensions it knows about by
+ * casting it to a more specific extension and optionally advertising
+ * the GLX extension. See below for examples.
+ */
+struct __DRIextensionRec {
+ const char *name;
+};
+
+
/**
* \name Functions provided by the driver loader.
*/
*/
void (*destroyScreen)(__DRIscreen *screen);
+ /**
+ * Method to get screen extensions.
+ */
+ const __DRIextension **(*getExtensions)(__DRIscreen *screen);
+
/**
* Method to create the private DRI drawable data and initialize the
* drawable dependent methods.
return psp;
}
+
+static void queryExtensions(__GLXscreenConfigs *psc)
+{
+ const __DRIextension **extensions;
+ int i;
+
+ extensions = psc->driScreen.getExtensions(&psc->driScreen);
+ for (i = 0; extensions[i]; i++) {
+ /* Unknown extension, just ignore... */
+ }
+}
+
#endif /* GLX_DIRECT_RENDERING */
CallCreateNewScreen(dpy, i, psc,
& priv->driDisplay,
priv->driDisplay.createNewScreen[i] );
+ if (psc->driScreen.private != NULL)
+ queryExtensions(psc);
}
}
#endif
}
/*@}*/
+static const __DRIextension **
+driGetExtensions(__DRIscreen *screen)
+{
+ __DRIscreenPrivate *psp = screen->private;
+ static const __DRIextension *extensions[1];
+
+ return extensions;
+}
/*****************************************************************/
/** \name Screen handling functions */
psp->dummyContextPriv.driScreenPriv = NULL;
psc->destroyScreen = driDestroyScreen;
+ psc->getExtensions = driGetExtensions;
psc->createNewDrawable = driCreateNewDrawable;
psc->getMSC = driGetMSC;
psc->createNewContext = driCreateNewContext;