XextCheckExtension(dpy, info, dri2ExtensionName, False);
switch ((wire->u.u.type & 0x7f) - info->codes->first_event) {
+
+#ifdef X_DRI2SwapBuffers
case DRI2_BufferSwapComplete:
{
GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
aevent->sbc = ((CARD64)awire->sbc_hi << 32) | awire->sbc_lo;
return True;
}
+#endif
+
default:
/* client doesn't support server event */
break;
SyncHandle();
}
+#ifdef X_DRI2SwapBuffers
static void
load_swap_req(xDRI2SwapBuffersReq *req, CARD64 target, CARD64 divisor,
CARD64 remainder)
UnlockDisplay(dpy);
SyncHandle();
}
+#endif
+#ifdef X_DRI2GetMSC
Bool DRI2GetMSC(Display *dpy, XID drawable, CARD64 *ust, CARD64 *msc,
CARD64 *sbc)
{
return True;
}
+#endif
+#ifdef X_DRI2WaitMSC
static void
load_msc_req(xDRI2WaitMSCReq *req, CARD64 target, CARD64 divisor,
CARD64 remainder)
return True;
}
+#endif
+#ifdef X_DRI2WaitSBC
static void
load_sbc_req(xDRI2WaitSBCReq *req, CARD64 target)
{
return True;
}
+#endif
+#ifdef X_DRI2SwapInterval
void DRI2SwapInterval(Display *dpy, XID drawable, int interval)
{
XExtDisplayInfo *info = DRI2FindDisplay(dpy);
UnlockDisplay(dpy);
SyncHandle();
}
+#endif
#endif /* GLX_DIRECT_RENDERING */
return 0;
}
+#ifdef X_DRI2SwapBuffers
DRI2SwapBuffers(pdraw->psc->dpy, pdraw->xDrawable, target_msc, divisor,
remainder, &ret);
+#endif
#if __DRI2_FLUSH_VERSION >= 2
if (pdraw->psc->f)
psp->swapBuffers = dri2SwapBuffers;
psp->waitGL = dri2WaitGL;
psp->waitX = dri2WaitX;
+ psp->getDrawableMSC = NULL;
+ psp->waitForMSC = NULL;
+ psp->waitForSBC = NULL;
+ psp->setSwapInterval = NULL;
+ psp->getSwapInterval = NULL;
+
if (pdp->driMinor >= 2) {
+#ifdef X_DRI2GetMSC
psp->getDrawableMSC = dri2DrawableGetMSC;
+#endif
+#ifdef X_DRI2WaitMSC
psp->waitForMSC = dri2WaitForMSC;
psp->waitForSBC = dri2WaitForSBC;
+#endif
+#ifdef X_DRI2SwapInterval
psp->setSwapInterval = dri2SetSwapInterval;
psp->getSwapInterval = dri2GetSwapInterval;
- } else {
- psp->getDrawableMSC = NULL;
- psp->waitForMSC = NULL;
- psp->waitForSBC = NULL;
- psp->setSwapInterval = NULL;
- psp->getSwapInterval = NULL;
+#endif
}
/* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always
pdp->driPatch = 0;
pdp->swapAvailable = 0;
+#ifdef X_DRI2SwapBuffers
if (pdp->driMinor >= 2)
pdp->swapAvailable = 1;
+#endif
pdp->base.destroyDisplay = dri2DestroyDisplay;
pdp->base.createScreen = dri2CreateScreen;
aevent->count = awire->count;
return True;
}
+ /* No easy symbol to test for this, as GLX_BufferSwapComplete is
+ * defined in the local glx.h header, but the
+ * xGLXBufferSwapComplete typedef is only available in new versions
+ * of the external glxproto.h header, which doesn't have any
+ * testable versioning define.
+ *
+ * I'll use the related DRI2 define, in the hope that we won't
+ * receive these events unless we know how to ask for them:
+ */
+#ifdef X_DRI2SwapBuffers
case GLX_BufferSwapComplete:
{
GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
aevent->sbc = ((CARD64)awire->sbc_hi << 32) | awire->sbc_lo;
return True;
}
+#endif
default:
/* client doesn't support server event */
break;