Create OpenGL Context only with XCB
Asked Answered
C

2

5

I want to create OpenGL Context only with XCB without GLX and Xlib. Could you tell me that might be happened.

Cristinacristine answered 24/9, 2015 at 8:5 Comment(2)
Jes, Qt5 use OpenGL with XCB and I want to use the seam context.Cristinacristine
@MiroslavAvramov: No it doesn't. GLX has been written against the Xlib specification, so you can't use GLX without having Xlib in your program. Sorry. You can mix Xcb with Xlib if you use the (now standard) Xlib that builds on top of Xcb.Bonnette
B
7

I want to create OpenGL Context only with XCB without GLX and Xlib.

You can't. Period. You need GLX, because that's how the X11 does OpenGL. And GLX is written against Xlib. The best you could do is use the Xcb GLX module to implement a purely indirect GLX context; limits you to OpenGL-2.1 though and everything has to pass through the X11 server, instead of having a direct context that talks directly to the GPU.

Bonnette answered 24/9, 2015 at 9:4 Comment(2)
A year has passed since these answer. Any updates on that? Couldn't find any myself.Definitive
@Julien: There's nothing to update on that. The formal definition of GLX builds on top of Xlib. That's not some minor implementation detail of how GLX implementations work. It's stated in the specification document for GLX, that Xlib is a hard requirement. You have to completely replace GLX with something else to get rid of the Xlib dependency. However you can minimize the footprint Xlib has on your program. Here's an example using Xlib just for OpenGL initialization and Xcb for everything else: github.com/datenwolf/codesamples/blob/master/samples/OpenGL/…Bonnette
D
2

You can use OpenGL via EGL with xcb. You need an EGL implementation that supports the EGL_EXT_platform_xcb extension, otherwise you need to use the 'x11' platform which requires an XLib display for the initial setup.

Mesa supports the extension starting from version 21.

Dionysus answered 25/9, 2022 at 18:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.