diff --git a/include/osgViewer/api/X11/PixelBufferX11 b/include/osgViewer/api/X11/PixelBufferX11 index 9e815f8a3..19806c148 100644 --- a/include/osgViewer/api/X11/PixelBufferX11 +++ b/include/osgViewer/api/X11/PixelBufferX11 @@ -85,6 +85,7 @@ class OSGVIEWER_EXPORT PixelBufferX11 : public osg::GraphicsContext, public osgV bool _useGLX1_3; bool _useSGIX; +#ifdef GLX_SGIX_pbuffer typedef Pbuffer ( *GLXCreateGLXPbufferSGIX_FuncPtr) (Display *dpy, GLXFBConfig config, unsigned int, unsigned height, int* attrib_list); typedef void ( *GLXDestroyGLXPbufferSGIX_FuncPtr) (Display *dpy, Pbuffer pbuf); typedef int ( *GLXQueryGLXPbufferSGIX_FuncCPtr) (Display *dpy, Pbuffer pbuf, int attribute, unsigned int *value); @@ -94,6 +95,7 @@ class OSGVIEWER_EXPORT PixelBufferX11 : public osg::GraphicsContext, public osgV GLXDestroyGLXPbufferSGIX_FuncPtr _glXDestroyGLXPbufferSGIX; GLXQueryGLXPbufferSGIX_FuncCPtr _glXQueryGLXPbufferSGIX; GLXGetFBConfigFromVisualSGIX_FuncPtr _glXGetFBConfigFromVisualSGIX; +#endif }; } diff --git a/src/osgViewer/PixelBufferX11.cpp b/src/osgViewer/PixelBufferX11.cpp index 8661af14e..5e7f9b280 100644 --- a/src/osgViewer/PixelBufferX11.cpp +++ b/src/osgViewer/PixelBufferX11.cpp @@ -33,12 +33,14 @@ PixelBufferX11::PixelBufferX11(osg::GraphicsContext::Traits* traits) _initialized(false), _realized(false), _useGLX1_3(false), - _useSGIX(false), - _glXCreateGLXPbufferSGIX(NULL), + _useSGIX(false) +#ifdef GLX_SGIX_pbuffer + ,_glXCreateGLXPbufferSGIX(NULL), _glXDestroyGLXPbufferSGIX(NULL), _glXQueryGLXPbufferSGIX(NULL), _glXGetFBConfigFromVisualSGIX(NULL) -{ +#endif + { _traits = traits; init(); @@ -179,7 +181,7 @@ void PixelBufferX11::init() haveGLX1_3 = true; } -#if defined(GLX_VERSION_1_1) +#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_pbuffer) // We need at least GLX 1.1 for glXQueryExtensionsString if (!haveGLX1_3 && 1 <= minor) {