🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

glXChooseVisual : Fatal IO error 11

Started by
2 comments, last by aryx 14 years, 4 months ago
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
Advertisement
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.

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
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 };

This topic is closed to new replies.

Advertisement