From f779c3a71a04f7771975a5953c6836e9f3fc4458 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 11 Dec 2007 14:39:15 +0000 Subject: [PATCH] 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. " --- src/osgViewer/PixelBufferX11.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/osgViewer/PixelBufferX11.cpp b/src/osgViewer/PixelBufferX11.cpp index 88506ce7c..156d8dfcf 100644 --- a/src/osgViewer/PixelBufferX11.cpp +++ b/src/osgViewer/PixelBufferX11.cpp @@ -164,9 +164,31 @@ void PixelBufferX11::init() _valid = false; return; } - + // osg::notify(osg::NOTICE)<<"GLX extension, errorBase="<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;