From Mathias Froehlich, "Attached is a change to the PBuffer initialsation code that checks for the GLX

version before issuing commands that require GLX-1.3.

This prevents a crash with open source drivers on linux.
"
This commit is contained in:
Robert Osfield
2007-12-11 14:39:15 +00:00
parent 8062406d54
commit f779c3a71a

View File

@@ -164,9 +164,31 @@ void PixelBufferX11::init()
_valid = false;
return;
}
// osg::notify(osg::NOTICE)<<"GLX extension, errorBase="<<errorBase<<" eventBase="<<eventBase<<std::endl;
int major, minor;
if (glXQueryVersion(_display, &major, &minor) == False)
{
osg::notify(osg::NOTICE) << "Error: " << XDisplayName(_traits->displayName().c_str())
<< " can not query GLX version." << std::endl;
XCloseDisplay( _display );
_display = 0;
_valid = false;
return;
}
// We need to have at least GLX 1.3 to use getFBConfigFromVisual and glXCreatePbuffer
if (major < 1 || (major == 1 && minor < 3))
{
osg::notify(osg::NOTICE) << "Error: " << XDisplayName(_traits->displayName().c_str())
<< " GLX version " << major << "." << minor << " is too little." << std::endl;
XCloseDisplay( _display );
_display = 0;
_valid = false;
return;
}
if (!createVisualInfo())
{
_traits->red /= 2;