We do this in the X server for DRI2.
__glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync");
__glXEnableDirectExtension(&psc->base, "GLX_SGI_swap_control");
__glXEnableDirectExtension(&psc->base, "GLX_MESA_swap_control");
+ __glXEnableDirectExtension(&psc->base, "GLX_SGI_make_current_read");
/* FIXME: if DRI2 version supports it... */
__glXEnableDirectExtension(&psc->base, "INTEL_swap_event");
}
extensions = psc->core->getExtensions(psc->driScreen);
- driBindCommonExtensions(&psc->base, extensions);
dri2BindExtensions(psc, extensions);
psc->base.configs =
free(configs);
}
-/* Bind extensions common to DRI1 and DRI2 */
-_X_HIDDEN void
-driBindCommonExtensions(__GLXscreenConfigs *psc,
- const __DRIextension **extensions)
-{
- int i;
-
- for (i = 0; extensions[i]; i++) {
-#ifdef __DRI_COPY_SUB_BUFFER
- if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
- psc->driCopySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
- __glXEnableDirectExtension(psc, "GLX_MESA_copy_sub_buffer");
- }
-#endif
-
-#ifdef __DRI_READ_DRAWABLE
- if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
- __glXEnableDirectExtension(psc, "GLX_SGI_make_current_read");
- }
-#endif
-
- /* Ignore unknown extensions */
- }
-}
-
#endif /* GLX_DIRECT_RENDERING */
extern void *driOpenDriver(const char *driverName);
-extern void driBindCommonExtensions(__GLXscreenConfigs * psc,
- const __DRIextension **extensions);
-
#endif /* _DRI_COMMON_H */
const __DRIswapControlExtension *swapControl;
const __DRImediaStreamCounterExtension *msc;
const __DRIconfig **driver_configs;
+ const __DRIcopySubBufferExtension *driCopySubBuffer;
void *driver;
int fd;
int x, int y, int width, int height)
{
struct dri_drawable *pdp = (struct dri_drawable *) pdraw;
+ struct dri_screen *psc = (struct dri_screen *) pdp->base.psc;
- (*pdp->base.psc->driCopySubBuffer->copySubBuffer) (pdp->driDrawable,
- x, y, width, height);
+ (*psc->driCopySubBuffer->copySubBuffer) (pdp->driDrawable,
+ x, y, width, height);
}
static void
__glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync");
}
+ if (strcmp(extensions[i]->name, __DRI_COPY_SUB_BUFFER) == 0) {
+ psc->driCopySubBuffer = (__DRIcopySubBufferExtension *) extensions[i];
+ __glXEnableDirectExtension(&psc->base, "GLX_MESA_copy_sub_buffer");
+ }
+
+ if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {
+ __glXEnableDirectExtension(&psc->base, "GLX_SGI_make_current_read");
+ }
/* Ignore unknown extensions */
}
}
extensions = psc->core->getExtensions(psc->driScreen);
driBindExtensions(psc, extensions);
- driBindCommonExtensions(&psc->base, extensions);
psp = &psc->vtable;
psc->base.driScreen = psp;
- if (psc->base.driCopySubBuffer)
+ if (psc->driCopySubBuffer)
psp->copySubBuffer = driCopySubBuffer;
psp->destroyScreen = driDestroyScreen;
}
extensions = psc->core->getExtensions(psc->driScreen);
- driBindCommonExtensions(&psc->base, extensions);
psc->base.configs =
driConvertConfigs(psc->core, psc->base.configs, driver_configs);
int scr;
__GLXDRIscreen *driScreen;
-
-#ifdef __DRI_COPY_SUB_BUFFER
- const __DRIcopySubBufferExtension *driCopySubBuffer;
-#endif
-
#endif
/**