[Xcb] Issues with XCB and OpenGL

Uli Schlachter psychon at znc.in
Sun Dec 1 08:46:04 PST 2013


On 01.12.2013 17:12, Xavier Bigand wrote:
> I am trying to make the XCB with OpenGL sample work :
> http://xcb.freedesktop.org/opengl/
>
> I am getting the following error :
> X Error of failed request:  BadWindow (invalid Window parameter)
>    Major opcode of failed request:  154 (GLX)
>    Minor opcode of failed request:  31 (X_GLXCreateWindow)
>    Resource id in failed request:  0x2e00004
>    Serial number of failed request:  26
>    Current serial number in output stream:  30
>
>
> I have a Mint 16 with open sources driver and an ATI card.
>
> Does it come from the sample code or my configuration?

Disclaimer: I have no clue about OpenGL.

I replaced the following code (line 76 and following):

         /* Select first framebuffer config and query visualID */
         GLXFBConfig fb_config = fb_configs[0];
         glXGetFBConfigAttrib(display, fb_config, GLX_VISUAL_ID , &visualID);

with this:

         /* Select first framebuffer config and query visualID */
         GLXFBConfig fb_config;
	int config = 0;
	for (config = 0; config < num_fb_configs; config++) {
		fb_config = fb_configs[config];
		visualID = 0;
		glXGetFBConfigAttrib(display, fb_config, GLX_VISUAL_ID , &visualID);
		if (visualID != 0)
			break;
		fprintf(stderr, "config %d of %d failed\n", config, num_fb_configs);
	}

This gives me the following output (and then opens a blue window):

config 0 of 24 failed
config 1 of 24 failed
config 2 of 24 failed
config 3 of 24 failed

Cheers,
Uli

P.S.: Could someone with more clue look at this and perhaps improve the example 
in the wiki? There must be a better way to check if glXGetFBConfigAttrib() failed.
P.P.S.: I left the "select the first[...]" comment in place, although it is now 
wrong.


More information about the Xcb mailing list