* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
*/
static void
ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
const CARD32 * attribs, size_t num_attribs)
{
struct glx_display *priv = __glXInitialize(dpy);
+#ifdef GLX_DIRECT_RENDERING
__GLXDRIdrawable *pdraw;
+#endif
CARD32 *output;
CARD8 opcode;
int i;
return;
}
- pdraw = GetGLXDRIDrawable(dpy, drawable);
-
opcode = __glXSetupForCommand(dpy);
if (!opcode)
return;
if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) {
xGLXChangeDrawableAttributesReq *req;
- GetReqExtra(GLXChangeDrawableAttributes, 8 + (8 * num_attribs), req);
+ GetReqExtra(GLXChangeDrawableAttributes, 8 * num_attribs, req);
output = (CARD32 *) (req + 1);
req->reqType = opcode;
else {
xGLXVendorPrivateWithReplyReq *vpreq;
- GetReqExtra(GLXVendorPrivateWithReply, 4 + (8 * num_attribs), vpreq);
+ GetReqExtra(GLXVendorPrivateWithReply, 8 + (8 * num_attribs), vpreq);
output = (CARD32 *) (vpreq + 1);
vpreq->reqType = opcode;
vpreq->vendorCode = X_GLXvop_ChangeDrawableAttributesSGIX;
output[0] = (CARD32) drawable;
- output++;
+ output[1] = num_attribs;
+ output += 2;
}
(void) memcpy(output, attribs, sizeof(CARD32) * 2 * num_attribs);
UnlockDisplay(dpy);
SyncHandle();
+#ifdef GLX_DIRECT_RENDERING
+ pdraw = GetGLXDRIDrawable(dpy, drawable);
+
+ if (!pdraw)
+ return;
+
for (i = 0; i < num_attribs; i++) {
switch(attribs[i * 2]) {
case GLX_EVENT_MASK:
break;
}
}
+#endif
return;
}
{
struct glx_display *const priv = __glXInitialize(dpy);
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
+ XID xid;
if (pdraw != NULL) {
- if (destroy_xdrawable)
- XFreePixmap(pdraw->psc->dpy, pdraw->xDrawable);
+ xid = pdraw->xDrawable;
(*pdraw->destroyDrawable) (pdraw);
__glxHashDelete(priv->drawHash, drawable);
+ if (destroy_xdrawable)
+ XFreePixmap(priv->dpy, xid);
}
}
* The number of attributes returned is likely to be small, probably less than
* 10. Given that, this routine should try to use an array on the stack to
* capture the reply rather than always calling Xmalloc.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
*/
static int
GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
if (use_glx_1_3) {
xGLXGetDrawableAttributesReq *req;
- GetReqExtra(GLXGetDrawableAttributes, 4, req);
+ GetReq(GLXGetDrawableAttributes, req);
req->reqType = opcode;
req->glxCode = X_GLXGetDrawableAttributes;
req->drawable = drawable;
/**
* Create a non-pbuffer GLX drawable.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
*/
static GLXDrawable
CreateDrawable(Display *dpy, struct glx_config *config,
CARD32 *data;
unsigned int i;
CARD8 opcode;
+ GLXDrawable xid;
i = 0;
if (attrib_list) {
req->screen = config->screen;
req->fbconfig = config->fbconfigID;
req->window = drawable;
- req->glxwindow = XAllocID(dpy);
+ req->glxwindow = xid = XAllocID(dpy);
req->numAttribs = i;
if (attrib_list)
UnlockDisplay(dpy);
SyncHandle();
- CreateDRIDrawable(dpy, config, drawable, req->glxwindow, attrib_list, i);
+ CreateDRIDrawable(dpy, config, drawable, xid, attrib_list, i);
- return req->glxwindow;
+ return xid;
}
LockDisplay(dpy);
- GetReqExtra(GLXDestroyPbuffer, 4, req);
+ GetReq(GLXDestroyPbuffer, req);
req->reqType = opcode;
req->glxCode = glxCode;
req->pbuffer = (GLXPbuffer) drawable;
* \note
* This function dynamically determines whether to use the SGIX_pbuffer
* version of the protocol or the GLX 1.3 version of the protocol.
- *
- * \todo
- * This function needs to be modified to work with direct-rendering drivers.
*/
static GLXDrawable
CreatePbuffer(Display * dpy, struct glx_config *config,