+
+static GLboolean
+CreateDRIDrawable(Display *dpy, struct glx_config *config,
+ XID drawable, XID glxdrawable,
+ const int *attrib_list, size_t num_attribs)
+{
+ struct glx_display *const priv = __glXInitialize(dpy);
+ __GLXDRIdrawable *pdraw;
+ struct glx_screen *psc;
+
+ if (priv == NULL) {
+ fprintf(stderr, "failed to create drawable\n");
+ return GL_FALSE;
+ }
+
+ psc = priv->screens[config->screen];
+ if (psc->driScreen == NULL)
+ return GL_TRUE;
+
+ pdraw = psc->driScreen->createDrawable(psc, drawable,
+ glxdrawable, config);
+ if (pdraw == NULL) {
+ fprintf(stderr, "failed to create drawable\n");
+ return GL_FALSE;
+ }
+
+ if (__glxHashInsert(priv->drawHash, glxdrawable, pdraw)) {
+ (*pdraw->destroyDrawable) (pdraw);
+ return GL_FALSE;
+ }
+
+ pdraw->textureTarget = determineTextureTarget(attrib_list, num_attribs);
+ pdraw->textureFormat = determineTextureFormat(attrib_list, num_attribs);
+
+ return GL_TRUE;
+}
+
+static void
+DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
+{
+ struct glx_display *const priv = __glXInitialize(dpy);
+ __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
+ XID xid;
+
+ if (priv != NULL && pdraw != NULL) {
+ xid = pdraw->xDrawable;
+ (*pdraw->destroyDrawable) (pdraw);
+ __glxHashDelete(priv->drawHash, drawable);
+ if (destroy_xdrawable)
+ XFreePixmap(priv->dpy, xid);
+ }
+}
+
+#else
+
+static GLboolean
+CreateDRIDrawable(Display *dpy, const struct glx_config * fbconfig,
+ XID drawable, XID glxdrawable,
+ const int *attrib_list, size_t num_attribs)
+{
+ return GL_TRUE;
+}
+
+static void
+DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
+{
+}
+