#include <sys/time.h>
#include <X11/extensions/xf86vmode.h>
#include "xf86dri.h"
+#define GC_IS_DIRECT(gc) ((gc)->driContext != NULL)
+#else
+#define GC_IS_DIRECT(gc) (0)
#endif
#if defined(USE_XCB)
req->visual = vis->visualid;
req->screen = vis->screen;
req->shareList = shareList ? shareList->xid : None;
-#ifdef GLX_DIRECT_RENDERING
- req->isDirect = gc->driContext != NULL;
-#else
- req->isDirect = 0;
-#endif
+ req->isDirect = GC_IS_DIRECT(gc);
}
else if (use_glx_1_3) {
xGLXCreateNewContextReq *req;
req->screen = fbconfig->screen;
req->renderType = renderType;
req->shareList = shareList ? shareList->xid : None;
-#ifdef GLX_DIRECT_RENDERING
- req->isDirect = gc->driContext != NULL;
-#else
- req->isDirect = 0;
-#endif
+ req->isDirect = GC_IS_DIRECT(gc);
}
else {
xGLXVendorPrivateWithReplyReq *vpreq;
req->screen = fbconfig->screen;
req->renderType = renderType;
req->shareList = shareList ? shareList->xid : None;
-#ifdef GLX_DIRECT_RENDERING
- req->isDirect = gc->driContext != NULL;
-#else
- req->isDirect = 0;
-#endif
+ req->isDirect = GC_IS_DIRECT(gc);
}
UnlockDisplay(dpy);
{
if (!gc) {
return GL_FALSE;
-#ifdef GLX_DIRECT_RENDERING
}
- else if (gc->driContext) {
+ else if (GC_IS_DIRECT(gc)) {
return GL_TRUE;
-#endif
}
return __glXIsDirect(dpy, gc->xid);
}
INT32 *buffer_ptr;
CARD8 opcode;
- if (gc == NULL)
- return;
-
-#ifdef GLX_DIRECT_RENDERING
- if (gc->driContext)
+ if ((gc == NULL) || GC_IS_DIRECT(gc))
return;
-#endif
opcode = __glXSetupForCommand(dpy);
if (!opcode)