From 75527fd800aa19e6c2076b70d8d5eb8d3b95ac12 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 26 Feb 2010 10:03:01 +0000 Subject: [PATCH] From Paul Martz, "Summary: GL3 deprecates "glGetString(GL_EXTENSIONS)". In GL3, individual extension strings are queried by looping over GL_NUM_EXTENSIONS and calling "glGetStringi(GL_EXTENSIONS,)". The fix is basically as follows: if( GL3 ) Query indexed extension strings. else Query the old way. The "else" branch is re-indented but otherwise shouldn't contain any changes." From Robert Osfield, added #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) to new block to prevent it being compiled under GLES where no glGetStringi exists. --- src/osg/GLExtensions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/osg/GLExtensions.cpp b/src/osg/GLExtensions.cpp index d95de7e89..a363dc567 100644 --- a/src/osg/GLExtensions.cpp +++ b/src/osg/GLExtensions.cpp @@ -91,6 +91,7 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex rendererString = renderer ? (const char*)renderer : ""; // get the extension list from OpenGL. + #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) if( osg::getGLVersionNumber() >= 3.0 ) { // OpenGL 3.0 adds the concept of indexed strings and @@ -105,9 +106,9 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex if( glGetStringi != NULL ) { - # ifndef GL_NUM_EXTENSIONS - # define GL_NUM_EXTENSIONS 0x821D - # endif + # ifndef GL_NUM_EXTENSIONS + # define GL_NUM_EXTENSIONS 0x821D + # endif GLint numExt; glGetIntegerv( GL_NUM_EXTENSIONS, &numExt ); int idx; @@ -122,6 +123,7 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex } } else + #endif { // Get extensions using GL1/2 interface.