<div dir="ltr">Thanks, I actually managed to fix it, kinda by luck!<div><br></div><div>The code that didn't work was:</div><div><br></div><div><div>fb_configs = glXGetFBConfigs(display, default_screen, &num_fb_configs);</div><div>if(!fb_configs || num_fb_configs == 0)</div><div>{</div><div>    fprintf(stderr, "glXGetFBConfigs failed\n");</div><div>    return -1;</div><div>}</div></div><div><div>/* Select first framebuffer config and query visualID */</div><div>GLXFBConfig fb_config = fb_configs[0];</div><div>glXGetFBConfigAttrib(display, fb_config, GLX_VISUAL_ID , &visualID);</div></div><div><br></div><div>It was choosing a display that didn't have GLX_X_RENDERABLE set.</div><div><br></div><div>Using glXChooseFBConfig I was able to get it to work:</div><div><div>int visualID = 0;</div><div>static int visual_attribs[] =</div><div>{</div><div>    GLX_X_RENDERABLE, True,</div><div>    GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,</div><div>    GLX_RENDER_TYPE, GLX_RGBA_BIT,</div><div>    GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,</div><div>    GLX_RED_SIZE, 8,</div><div>    GLX_GREEN_SIZE, 8,</div><div>    GLX_BLUE_SIZE, 8,</div><div>    GLX_ALPHA_SIZE, 8,</div><div>    GLX_DEPTH_SIZE, 24,</div><div>    GLX_STENCIL_SIZE, 8,</div><div>    GLX_DOUBLEBUFFER, True,</div><div>    None<br></div><div>};</div><div><br></div><div>int num_fb_configs = 0;<br></div><div>GLXFBConfig *fb_configs = 0;</div><div>fb_configs = glXChooseFBConfig(display, default_screen, visual_attribs, &num_fb_configs);</div></div><div><br></div><div>Is there any way I can update the page on the website with this working code?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 6, 2018 at 11:03 AM, Uli Schlachter <span dir="ltr"><<a href="mailto:psychon@znc.in" target="_blank">psychon@znc.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
On 05.06.2018 02:07, Thomas Fischer wrote:<br>
> I've been trying to compile the code from<br>
> <a href="https://xcb.freedesktop.org/opengl/" rel="noreferrer" target="_blank">https://xcb.freedesktop.org/<wbr>opengl/</a><br>
> tl;dr: The code used Xlib to interact with glx, but uses xcb to handle X<br>
> events.<br>
> <br>
> It seems to not run because of something happening in xcb_create_colormap,<br>
> <br>
> I changed the code to use create_colormap_checked, and printed out the<br>
> error structure, this was the response, if it's useful:<br>
> =============ERROR============<wbr>=<br>
> Could not create the colormap<br>
>         error->response_type: 0<br>
>         error->error_code: 8<br>
>         error->sequence: 31<br>
>         error->resource_id: 0<br>
>         error->minor_code: 0<br>
>         error->major_code: 78<br>
>         error->full_sequence: 31<br>
> ==============================<wbr>=<br>
<br>
</span>Error 8 is XCB_MATCH / BadMatch.<br>
<br>
According to [1], CreateColormap produces a Match error if the visual is<br>
not supported by the screen. That's all that I can say, sorry. I know<br>
basically nothing about GLX. (Well, you could print out the value of<br>
visualID and look it up in the output of /usr/bin/xdpyinfo)<br>
<br>
Cheers,<br>
Uli<br>
<br>
[1]: <a href="https://www.x.org/releases/X11R7.5/doc/x11proto/proto.html" rel="noreferrer" target="_blank">https://www.x.org/releases/<wbr>X11R7.5/doc/x11proto/proto.<wbr>html</a><br>
<span class="HOEnZb"><font color="#888888">-- <br>
Homophobia - The fear that another man will treat you the way you treat<br>
women.<br>
</font></span></blockquote></div><br></div>