diff --git a/include/osg/CameraNode b/include/osg/CameraNode index 33f870d1e..e1e4eac66 100644 --- a/include/osg/CameraNode +++ b/include/osg/CameraNode @@ -193,10 +193,10 @@ class OSG_EXPORT CameraNode : public Transform, public CullSettings /** Set the draw buffer for a given fragment output position to specified draw buffer. */ - void setDrawBuffer(unsigned int pos, GLenum buffer); + void setDrawBuffer(unsigned int pos, GLenum buffer) { _drawBufferList[pos] = buffer; } /** Get the draw buffer for a given fragment output position. */ - GLenum getDrawBuffer(unsigned int pos); + GLenum getDrawBuffer(unsigned int pos) const { return _drawBufferList[pos]; } typedef std::vector DrawBufferList; diff --git a/src/osgUtil/RenderToTextureStage.cpp b/src/osgUtil/RenderToTextureStage.cpp index 33a2ad3f9..5da128190 100644 --- a/src/osgUtil/RenderToTextureStage.cpp +++ b/src/osgUtil/RenderToTextureStage.cpp @@ -41,7 +41,9 @@ void RenderToTextureStage::draw(osg::State& state,RenderLeaf*& previous) //cout << "begining RTTS draw "<x()<<","<< _viewport->y()<<","<< _viewport->width()<<","<< _viewport->height()<isSupported(); + + if (fbo_supported) { _fbo->apply(state); } @@ -50,7 +52,7 @@ void RenderToTextureStage::draw(osg::State& state,RenderLeaf*& previous) RenderStage::draw(state,previous); // now copy the rendered image to attached texture. - if (_texture.valid() && !fbo_ext) + if (_texture.valid() && !fbo_supported) { //cout << " reading "<x()<<","<< _viewport->y()<<","<< _viewport->width()<<","<< _viewport->height()<readPixels(_viewport->x(),_viewport->y(),_viewport->width(),_viewport->height(),_imageReadPixelFormat,_imageReadPixelDataType); - if (fbo_ext) + if (fbo_supported) { fbo_ext->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } } +