Any help would be appreciated…I started X programming and am trying to initialize an opengl window with this code but the GLXWindow refuses to becreated with a messaged of “failed to create drawable”.
int attribs[] = {GLX_BUFFER_SIZE, 32,
GLX_SAMPLE_BUFFERS, 0,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_X_RENDERABLE, True,
GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
GLX_CONFIG_CAVEAT, GLX_NONE,
GLX_TRANSPARENT_TYPE, GLX_NONE,
GLX_DOUBLEBUFFER, True,
GLX_STEREO, False,
GLX_AUX_BUFFERS, 0,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_ALPHA_SIZE, 8,
GLX_DEPTH_SIZE, 24,
GLX_STENCIL_SIZE, 8,
None};
int numOfConfigs;
GLXFBConfig *config;
int tmp;
XVisualInfo *xvis;
display = XOpenDisplay(NULL);
if(glXQueryExtension(display, &tmp, &tmp))
cout << "glX support found.
";
config = glXChooseFBConfig(display, DefaultScreen(display), attribs, &numOfConfigs);
cout << numOfConfigs << " configurations found.
";
if((xvis = glXGetVisualFromFBConfig(display, *config))!= NULL)
cout << "corresponding X visual found.
";
if((context = glXCreateNewContext(display, *config, GLX_RGBA_TYPE, NULL, True))!=NULL)
cout << "context created.
";
win = XCreateWindow(display, DefaultRootWindow(display), 0, 0, 800, 600, 0,
xvis->depth, InputOutput, xvis->visual,
0, NULL);
XMapRaised(display, win);
glxwin = glXCreateWindow(display, *config, win, NULL);
if(glXMakeContextCurrent(display, glxwin, glxwin, context))
cout << "context binding successful.
";
XFree(xvis);
XFree(config);
Any suggestions welcome!
I’m using ubuntu intrepid with the open-source drivers(proprietary ones don’t work for now…)