[Xcb] Status of XCB-GLX?

Peter Harris git at peter.is-a-geek.org
Sun Jan 29 07:06:35 PST 2012


On Sat, Jan 28, 2012 at 10:49 PM, Troy Watson wrote:
> What's the status of XCB-GLX now? I've looked through the mailing
> list, read the docs I could find, but recent information is scarce.

As Julian says, the status is unchanged.

> [1] "Although writing a OpenGL application on X Windows using pure XCB
> is not possible...".
> The page was updated approx 18 months ago. Is this still accurate?
> I've seen code posted here that tries to use pure XCB, but that code
> doesn't work. [2]

It's possible (though not easy[1]) to write a pure XCB-GLX application
if you're happy with indirect rendering.

It is not currently possible to write an OpenGL application using pure XCB.

The example at your link calls into an OpenGL library without
initializing that library. For example, the gl* functions cannot
possibly work unless and until you call glXMakeCurrent. In theory, a
pure XCB OpenGL application is possible, but your OpenGL library would
have to expose a glXCBMakeCurrent function (and replacements for some
of the other glX* functions) and I'm not aware of any that currently
do.

> Are there any recent code examples or projects using XCB-GLX I could
> learn from? I've looked at the VLC source, and they're still mixing
> XCB/Xlib calls.

Mixing XCB and Xlib is a perfectly valid way to interact with legacy
libraries that haven't been updated to XCB yet.

(Note that, due to some unfortunate design decisions, most OpenGL GLX
libraries are incompatible with XSetEventQueueOwner)

If it makes you feel better, the Mesa OpenGL library also calls
XGetXCBConnection and uses XCB where appropriate.

Peter Harris

[1] You have to marshal your own xcb_glx_render requests, and I'm
unaware of any helpers. You don't get to call any function that starts
with gl.


More information about the Xcb mailing list