[Xcb] No opengl3 rendering

Remi Thebault remi.thebault at gmail.com
Sun Nov 1 01:50:06 PST 2015


Hello

I try to open a GL3 context in a window created with XCB but I can't get 
it work.
I can get a working context with Xlib / XGL API with the code here:
www.opengl.org/wiki/Tutorial:_OpenGL_3.0_Context_Creation_%28GLX%29

When I replace the colormap and window creation with xcb code, I don't 
get any error reported, but the window do not contain anything more than 
the framebuffer content that was behind it.

glXIsDirect and glXMakeCurrent both return 1, glGetError() do not report 
anything

any idea?

here is a code extract:
     XVisualInfo *vi = glXGetVisualFromFBConfig( display, bestFbc );

     xcb_colormap_t cmap = xcb_generate_id(connection);
     xcb_window_t xcb_win = xcb_generate_id(connection);


     /* Create colormap */
     xcb_create_colormap(
         connection,
         XCB_COLORMAP_ALLOC_NONE,
         cmap,
         screen->root,
         vi->visualid
         );

     int cw_mask = XCB_CW_BORDER_PIXEL | XCB_CW_EVENT_MASK | 
XCB_CW_COLORMAP;
     int cw_values[] = {
         0,                                  // border pixel
         XCB_EVENT_MASK_STRUCTURE_NOTIFY,    // event mask
         cmap                                // colormap
     };

     xcb_void_cookie_t cookie = xcb_create_window_checked(
             connection,
             vi->depth,
             xcb_win,
             screen->root,
             0, 0,
             640, 480,
             0,
             XCB_WINDOW_CLASS_INPUT_OUTPUT,
             vi->visualid,
             cw_mask,
             cw_values
         );

Is it mandatory to create a GLXWindow on top of the xcb window?
(I tried but without change in the result)

thank you
Remi


More information about the Xcb mailing list