PDA

View Full Version : glXChooseVisual : Fatal IO error 11



kinju
02-20-2010, 06:13 AM
Hello,

I'm new on OpenGL under linux, and I'm trying to port my graphic engine onto this OS.

To get display info, I'm doing this :


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* xvinfo = glXChooseVisual(pDisplay, scr, attribs);


But glXChooseVisual crash my application with this error :

Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0

What does it mean ? Can I do something ?

Thank you very much,

Aurélien

Brolingstanz
02-21-2010, 02:50 PM
Shouldn't you be calling glXChooseFBConfig or something?

Dark Photon
02-22-2010, 07:05 PM
To get display info, I'm doing this :


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* xvinfo = glXChooseVisual(pDisplay, scr, attribs);


But glXChooseVisual crash my application with this error :

Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0

Your glXChooseVisual call looks good, assuming pDisplay and scr are reasonable. Try using DefaultScreen instead of XDefaultScreen. Prob the same, but here I'm using the former.

And in an app here that uses glXChooseVisual that works just fine, I use a more definitive attribute list, though the lack of one shoudn't be the cause of your problems:

int attribs[] = { GLX_RGBA, GLX_RED_SIZE, 8, GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, GLX_DEPTH_SIZE, 24, GLX_STENCIL_SIZE, 8, GLX_DOUBLEBUFFER, None }

I tend to suspect a problem in the your gtk/gdk lines rather than the latter...

Try this instead of using gtk/gdk for basic X init, and assuming it works, debug from there:

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=241530#Post2415 30