Skip to content

Commit

Permalink
Fixes for removal of FBOExtensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartz committed Dec 11, 2015
1 parent 922f38e commit a90a986
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions examples/msmrt/msmrt.cpp
Expand Up @@ -50,7 +50,11 @@ class MSMRTCallback : public osg::Camera::DrawCallback
{
osg::State& state = *renderInfo.getState();
const unsigned int ctx = state.getContextID();
#if( OSGWORKS_OSG_VERSION >= OSG_FBO_CHANGE_2_VERSION )
osg::GLExtensions* fboExt = osg::GLExtensions::Get( ctx, true );
#else
osg::FBOExtensions* fboExt = osg::FBOExtensions::instance( ctx, true );
#endif

PerContextInfo& ctxInfo( _contextInfo[ ctx ] );
if( ctxInfo.__glGetFramebufferAttachmentParameteriv == NULL )
Expand Down
2 changes: 1 addition & 1 deletion include/osgwTools/FBOUtils.h
Expand Up @@ -93,7 +93,7 @@ OSG versions.



#if OSG_MIN_VERSION_REQUIRED( 3,3,3 )
#if( OSGWORKS_OSG_VERSION >= OSG_FBO_CHANGE_2_VERSION )
GLvoid OSGWTOOLS_EXPORT glGenFramebuffers( osg::GLExtensions* fboExt, GLsizei n, GLuint* framebuffer );
GLvoid OSGWTOOLS_EXPORT glDeleteFramebuffers( osg::GLExtensions* fboExt, GLsizei n, GLuint* framebuffer );
GLvoid OSGWTOOLS_EXPORT glBindFramebuffer( osg::GLExtensions* fboExt, GLenum target, GLuint framebuffer );
Expand Down
15 changes: 10 additions & 5 deletions src/osgwTools/FBOUtils.cpp
Expand Up @@ -27,10 +27,15 @@ namespace osgwTools
{


// Version in which OSG removed "EXT" off of FBO commands.
// (E.g., "glGenFramebuffersEXT" became "glGenFramebuffers".
#define OSG_FBO_CHANGE_VERSION 20906
// Version in which OSG moved FBO commands from osg::FBOExtensions object
// to osg::GLExtensions object, and removed FBOExtensions object altogether.
#define OSG_FBO_CHANGE_2_VERSION 30303


#if OSG_MIN_VERSION_REQUIRED(3,3,3)
#if( OSGWORKS_OSG_VERSION >= OSG_FBO_CHANGE_2_VERSION )
GLvoid glGenFramebuffers( osg::GLExtensions* fboExt, GLsizei n, GLuint* framebuffer )
#else
GLvoid glGenFramebuffers( osg::FBOExtensions* fboExt, GLsizei n, GLuint* framebuffer )
Expand All @@ -43,7 +48,7 @@ GLvoid glGenFramebuffers( osg::FBOExtensions* fboExt, GLsizei n, GLuint* framebu
#endif
}

#if OSG_MIN_VERSION_REQUIRED(3,3,3)
#if( OSGWORKS_OSG_VERSION >= OSG_FBO_CHANGE_2_VERSION )
GLvoid glDeleteFramebuffers( osg::GLExtensions* fboExt, GLsizei n, GLuint* framebuffer )
#else
GLvoid glDeleteFramebuffers( osg::FBOExtensions* fboExt, GLsizei n, GLuint* framebuffer )
Expand All @@ -56,7 +61,7 @@ GLvoid glDeleteFramebuffers( osg::FBOExtensions* fboExt, GLsizei n, GLuint* fram
#endif
}

#if OSG_MIN_VERSION_REQUIRED(3,3,3)
#if( OSGWORKS_OSG_VERSION >= OSG_FBO_CHANGE_2_VERSION )
GLvoid glBindFramebuffer( osg::GLExtensions* fboExt, GLenum target, GLuint framebuffer )
#else
GLvoid glBindFramebuffer( osg::FBOExtensions* fboExt, GLenum target, GLuint framebuffer )
Expand All @@ -70,7 +75,7 @@ GLvoid glBindFramebuffer( osg::FBOExtensions* fboExt, GLenum target, GLuint fram
}


#if OSG_MIN_VERSION_REQUIRED(3,3,3)
#if( OSGWORKS_OSG_VERSION >= OSG_FBO_CHANGE_2_VERSION )
GLvoid glFramebufferTexture2D( osg::GLExtensions* fboExt, GLenum target, GLenum attachment,
GLenum textarget, GLuint texture, GLint level )
#else
Expand All @@ -85,7 +90,7 @@ GLvoid glFramebufferTexture2D( osg::FBOExtensions* fboExt, GLenum target, GLenum
#endif
}

#if OSG_MIN_VERSION_REQUIRED(3,3,3)
#if( OSGWORKS_OSG_VERSION >= OSG_FBO_CHANGE_2_VERSION )
GLvoid glBlitFramebuffer( osg::GLExtensions* fboExt, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter )
#else
Expand Down

0 comments on commit a90a986

Please sign in to comment.