diff options
author | Michel Dänzer <[email protected]> | 2009-08-30 12:43:37 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2009-08-30 12:53:00 +0200 |
commit | edb117879846155632aaeb66483a3085c7a78815 (patch) | |
tree | 81b909e556082018534e8947584d63baf466ff95 /src/glx | |
parent | 9399b9a0e27915dd5a388ff42ad99a9024c79b33 (diff) |
glx/x11: Fix glXCreateGLXPixmap for direct rendering.
Fixes progs/xdemos/glxpixmap modified to use direct rendering.
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/x11/glxcmds.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c index 820d8b98685..3242ac77121 100644 --- a/src/glx/x11/glxcmds.c +++ b/src/glx/x11/glxcmds.c @@ -845,6 +845,34 @@ PUBLIC GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis, req->glxpixmap = xid = XAllocID(dpy); UnlockDisplay(dpy); SyncHandle(); + +#ifdef GLX_DIRECT_RENDERING + do { + /* FIXME: Maybe delay __DRIdrawable creation until the drawable + * is actually bound to a context... */ + + __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + __GLXDRIdrawable *pdraw; + __GLXscreenConfigs *psc; + __GLcontextModes *modes; + + psc = &priv->screenConfigs[vis->screen]; + if (psc->driScreen == NULL) + break; + modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); + pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes); + if (pdraw == NULL) { + fprintf(stderr, "failed to create pixmap\n"); + break; + } + + if (__glxHashInsert(psc->drawHash, req->glxpixmap, pdraw)) { + (*pdraw->destroyDrawable) (pdraw); + return None; /* FIXME: Check what we're supposed to do here... */ + } + } while (0); +#endif + return xid; } |