Sign in to follow this  
Kinju

glXChooseVisual : Fatal IO error 11

Recommended Posts

Hello everybody, I'm new on Linux and I'm trying to port my graphic engine on this OS, with GTK+ Gui. I have a window with have a panel where I want to put the OpenGL render. To retrieve the visual infos, I use : GdkDisplay* pGtkDisplay = gtk_widget_get_display(m_pWidget); Display* pDisplay = gdk_x11_display_get_xdisplay(pGtkDisplay); int scr = XDefaultScreen(pDisplay); GLint attribs[] = {GLX_RGBA, GLX_DEPTH_SIZE, 24, None}; XVisualInfo *vis = glXChooseVisual(pDisplay, scr, attribs); And I get this error in the debugger: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0 Can I do something ? Thank you very much, Aurélien

Share this post


Link to post
Share on other sites
I've never entirely understood, despite yonks of experimentation and investigation, how the XVisual picker is supposed to work; every sensible value I tried failed with the same sort of error -- or just failed to find a valid visual and chucked back a null.

After some hacking about, I came to the conclusion that along the long and windy road which connects the glx spec, the documentation, the linux glx implementers, the example programs and then the ones amongst that group which actually run (eg glxgears) someone, somewhere got confused.

Although all the examples I've see claim that you do "FOO, 8" to get a minimum 8 bit version of a whatever, it actually seems to be a fib.

Saying;

int attributes[] = {
GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
None };

Seems to produce the desired effect of getting a sensible opengl buffer with all the bits and bobs needed. According to the spec, "FOO, 1" will just find you the largest FOO available compatible with the other options, which seems to leave the card interface with enough freedom to pick the right answer for the hardware. Since the cards just won't do 1 bit red buffers or 3 bit depth buffers, what you end up getting is the right answer.

Share this post


Link to post
Share on other sites
Hello,

Thanks for your answer.

I tried with these attributes but it produce the same crashe...

I'll try by using XGetVisualInfo and glXGetConfig and I'll keep you informed.

Thanks,

Aurélien

Share this post


Link to post
Share on other sites
I've never personally had this issue, but I also haven't tried anything on Linux yet. How about running the glxinfo command to see what kind of capabilities you have. On OS X the following set of attributes have worked for me:
	static int attrib[] = {
GLX_RGBA,
GLX_DEPTH_SIZE, 32,
GLX_STENCIL_SIZE, 1,
GLX_DOUBLEBUFFER,
None };

Share this post


Link to post
Share on other sites
Sign in to follow this