Do not ask for AA if not supported.

This commit is contained in:
Guillermo S. Romero 2010-01-07 23:23:00 +00:00
parent f3a6474537
commit 840ae92052

@ -171,8 +171,14 @@ GHOST_WindowX11(
int attributes[40], i = 0;
Atom atoms[2];
int natom;
int natom;
int glxVersionMajor, glxVersionMinor; // As in GLX major.minor
if (!glXQueryVersion(m_display, &glxVersionMajor, &glxVersionMinor)) {
printf("%s:%d: X11 glXQueryVersion() failed, verify working openGL system!\n", __FILE__, __LINE__);
return;
}
if(m_stereoVisual)
attributes[i++] = GLX_STEREO;
@ -183,15 +189,17 @@ GHOST_WindowX11(
attributes[i++] = GLX_GREEN_SIZE; attributes[i++] = 1;
attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1;
/* GLX 1.4+, multi-sample */
attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;
attributes[i++] = GLX_SAMPLES; attributes[i++] = m_numOfAASamples;
if((glxVersionMajor >= 1) && (glxVersionMinor >= 4)) {
attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;
attributes[i++] = GLX_SAMPLES; attributes[i++] = m_numOfAASamples;
}
attributes[i] = None;
m_visual = glXChooseVisual(m_display, DefaultScreen(m_display), attributes);
if (m_visual == NULL) {
// barf : no visual meeting these requirements could be found.
printf("%s:%d: X11 glxChooseVisual() failed for OpenGL, verify working openGL system!\n", __FILE__, __LINE__);
printf("%s:%d: X11 glXChooseVisual() failed, verify working openGL system!\n", __FILE__, __LINE__);
return;
}