summaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
authorRALOVICH, Kristóf <[email protected]>2008-10-18 17:00:13 +0200
committerBrian Paul <[email protected]>2008-11-26 10:00:58 -0700
commitfd52001c5c292d3b625c164a6c3c357e1da443e0 (patch)
treea39f9d3a8bd9b4cdb139095b8c7793c49cd14a1e /src/glx
parent5444424562781a0a40559db40dfe9b97286dc9da (diff)
glx: implement QueryVersion using XCB
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/x11/glxext.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index b6bdbd52bb5..d185942ddbe 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -139,7 +139,8 @@ XEXT_GENERATE_FIND_DISPLAY(__glXFindDisplay, __glXExtensionInfo,
** Free the per screen configs data as well as the array of
** __glXScreenConfigs.
*/
- static void FreeScreenConfigs(__GLXdisplayPrivate * priv)
+static void
+FreeScreenConfigs(__GLXdisplayPrivate * priv)
{
__GLXscreenConfigs *psc;
GLint i, screens;
@@ -221,6 +222,25 @@ __glXFreeDisplayPrivate(XExtData * extension)
static Bool
QueryVersion(Display * dpy, int opcode, int *major, int *minor)
{
+#ifdef USE_XCB
+ xcb_connection_t *c = XGetXCBConnection(dpy);
+ xcb_glx_query_version_reply_t* reply =
+ xcb_glx_query_version_reply(c,
+ xcb_glx_query_version(c,
+ GLX_MAJOR_VERSION,
+ GLX_MINOR_VERSION),
+ NULL);
+
+ if(reply->major_version != GLX_MAJOR_VERSION)
+ {
+ free(reply);
+ return GL_FALSE;
+ }
+ *major = reply->major_version;
+ *minor = min(reply->minor_version, GLX_MINOR_VERSION);
+ free(reply);
+ return GL_TRUE;
+#else
xGLXQueryVersionReq *req;
xGLXQueryVersionReply reply;
@@ -245,6 +265,7 @@ QueryVersion(Display * dpy, int opcode, int *major, int *minor)
*major = reply.majorVersion;
*minor = min(reply.minorVersion, GLX_MINOR_VERSION);
return GL_TRUE;
+#endif /* USE_XCB */
}