Show
Ignore:
Timestamp:
02/26/10 11:03:01 (4 years ago)
Author:
robert
Message:

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,<index>)".

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osg/GLExtensions.cpp

    r11125 r11126  
    9292 
    9393            // get the extension list from OpenGL. 
     94            #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) 
    9495            if( osg::getGLVersionNumber() >= 3.0 ) 
    9596            { 
     
    106107                if( glGetStringi != NULL ) 
    107108                { 
    108     #  ifndef GL_NUM_EXTENSIONS 
    109     #    define GL_NUM_EXTENSIONS 0x821D 
    110     #  endif 
     109                    #  ifndef GL_NUM_EXTENSIONS 
     110                    #    define GL_NUM_EXTENSIONS 0x821D 
     111                    #  endif 
    111112                    GLint numExt; 
    112113                    glGetIntegerv( GL_NUM_EXTENSIONS, &numExt ); 
     
    123124            } 
    124125            else 
     126            #endif 
    125127            { 
    126128                // Get extensions using GL1/2 interface.