[Xcb] XCB and OpenGL, help and/or project ideas wanted

Riku Salminen maililistaalterego at gmail.com
Wed Jun 17 04:53:30 PDT 2009


Hi,

a couple of weeks ago I started working with XCB and OpenGL, with my
ambitious goal set to getting an XCB application working with hardware
accelerated OpenGL 3.0. I quickly realized that it's not as easy as it
seems (by looking at the xcb_glx functions that look exactly like the
glX functions you usually use). My intent was to add necessary GLX
extension bindings, etc for OpenGL 3 context creation to XCB-GLX. I
actually did write some xml protocol descriptions for
GLX_ARB_create_context and I got it partly working (glXSetClientInfoARB
function has some quirky padding I can't figure out in xml so I didn't
do it).

After a while I realized that XCB-GLX by itself cannot be used to set up
a rendering context. For that you need the GLX api from your OpenGL
implementation (from libGL.so). In addition to sending the normal X
requests, the GLX API functions modify local client state that's hidden
in libGL.so. The GLX API is closely tied to Xlib and there's no way to
use it without Xlib.

I did figure out a quick and dirty workaround to use OpenGL with XCB. I
was able to set up a rendering context using GLX 1.3 (fbconfigs instead
of visuals) and GLX 1.4/OpenGL 3.0 (using GLX_ARB_create_context). I did
this by using XCB-based Xlib, opening a Display with XOpenDisplay and
then getting the XCB connection with XGetXCBConnection and acquiring
event queue ownership with XSetEventQueueOwner. Then I used the Xlib
Display with the glX* functions and XCB for creating a window, event
handling, and everything else. However, it seems that an XCB-only
application that uses OpenGL is not possible at the moment.

The solution would be to have an XCBified replacement for the GLX API,
but since the GLX API is standardized, this is one of those 80%
political 20% technical issues.

And now for the questions:

Can anyone verify my findings?

What is the general status of XCB/OpenGL at the moment and who is or has
been working on it?

XCB-only OpenGL does not seem to be possible with proprietary graphics
driver-provided OpenGL implementations, but what about Mesa? If it's
possible, how do you set up a Mesa-OpenGL context with XCB? Are there
any open source graphics drivers that can be used with XCB?

I'm kind of in a hairy situation at the moment, I am participating in a
campaign called Kesäkoodi (http://www.coss.fi/kesakoodi), which is
similar to Google's Summer of Code. So I'm getting paid for three months
to work on XCB. My project is supposed to be XCB/OpenGL, but I guess
it's not that restricted.

So, now that I'm stuck, I'd like to hear about ideas on how to go on. If
there's nothing on XCB/OpenGL, another XCB-related project will do.

X Input methods/internationalized text input could be an intresting
project to work on, what's the status of that on XCB?

Thanks for any help,
-Riku Salminen
project blog: http://kesakoodi2k9.wordpress.com/


More information about the Xcb mailing list