#else
#endif
-#if defined(USE_XCB)
#include <X11/Xlib-xcb.h>
#include <xcb/xcb.h>
#include <xcb/glx.h>
-#endif
static const char __glXGLXClientVendorName[] = "Mesa Project and SGI";
static const char __glXGLXClientVersion[] = "1.4";
static Bool
__glXIsDirect(Display * dpy, GLXContextID contextID)
{
-#if !defined(USE_XCB)
- xGLXIsDirectReq *req;
- xGLXIsDirectReply reply;
-#endif
CARD8 opcode;
opcode = __glXSetupForCommand(dpy);
return GL_FALSE;
}
-#ifdef USE_XCB
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_generic_error_t *err;
xcb_glx_is_direct_reply_t *reply = xcb_glx_is_direct_reply(c,
free(reply);
return is_direct;
-#else
- /* Send the glXIsDirect request */
- LockDisplay(dpy);
- GetReq(GLXIsDirect, req);
- req->reqType = opcode;
- req->glxCode = X_GLXIsDirect;
- req->context = contextID;
- _XReply(dpy, (xReply *) & reply, 0, False);
- UnlockDisplay(dpy);
- SyncHandle();
-
- return reply.isDirect;
-#endif /* USE_XCB */
}
/**
struct glx_context *gc;
GLXContextTag tag;
CARD8 opcode;
-#ifdef USE_XCB
xcb_connection_t *c;
-#else
- xGLXSwapBuffersReq *req;
-#endif
gc = __glXGetCurrentContext();
__GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
if (pdraw != NULL) {
- if (gc && drawable == gc->currentDrawable) {
- glFlush();
- }
+ Bool flush = gc && drawable == gc->currentDrawable;
- (*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0);
+ (*pdraw->psc->driScreen->swapBuffers)(pdraw, 0, 0, 0, flush);
return;
}
}
tag = 0;
}
-#ifdef USE_XCB
c = XGetXCBConnection(dpy);
xcb_glx_swap_buffers(c, tag, drawable);
xcb_flush(c);
-#else
- /* Send the glXSwapBuffers request */
- LockDisplay(dpy);
- GetReq(GLXSwapBuffers, req);
- req->reqType = opcode;
- req->glxCode = X_GLXSwapBuffers;
- req->drawable = drawable;
- req->contextTag = tag;
- UnlockDisplay(dpy);
- SyncHandle();
- XFlush(dpy);
-#endif /* USE_XCB */
#endif /* GLX_USE_APPLEGL */
}
/* Test that all bits from a are contained in b */
#define MATCH_MASK(param) \
do { \
- if ((a->param & ~b->param) != 0) \
+ if ( ((int) a-> param != (int) GLX_DONT_CARE) \
+ && ((a->param & ~b->param) != 0) ) { \
return False; \
+ } \
} while (0);
/**
char *ext_str = __glXGetClientGLExtensionString();
int size = strlen(ext_str) + 1;
-#ifdef USE_XCB
xcb_connection_t *c = XGetXCBConnection(dpy);
xcb_glx_client_info(c,
GLX_MAJOR_VERSION, GLX_MINOR_VERSION, size, ext_str);
-#else
- xGLXClientInfoReq *req;
-
- /* Send the glXClientInfo request */
- LockDisplay(dpy);
- GetReq(GLXClientInfo, req);
- req->reqType = opcode;
- req->glxCode = X_GLXClientInfo;
- req->major = GLX_MAJOR_VERSION;
- req->minor = GLX_MINOR_VERSION;
-
- req->length += (size + 3) >> 2;
- req->numbytes = size;
- Data(dpy, ext_str, size);
-
- UnlockDisplay(dpy);
- SyncHandle();
-#endif /* USE_XCB */
free(ext_str);
}
struct glx_config *mode;
uint32_t fbconfigID = 0;
uint32_t visualID = 0;
- uint32_t screen;
+ uint32_t screen = 0;
Bool got_screen = False;
/* The GLX_EXT_import_context spec says:
#ifdef GLX_DIRECT_RENDERING
if (psc->driScreen && psc->driScreen->swapBuffers)
return (*psc->driScreen->swapBuffers)(pdraw, target_msc, divisor,
- remainder);
+ remainder, False);
#endif
return -1;
if (pdraw != NULL) {
struct glx_screen *psc = pdraw->psc;
if (psc->driScreen->copySubBuffer != NULL) {
- glFlush();
- (*psc->driScreen->copySubBuffer) (pdraw, x, y, width, height);
+ (*psc->driScreen->copySubBuffer) (pdraw, x, y, width, height, True);
}
return;