Set the draw and read buffer to GL_NONE when using FBO's, thereby avoid

invalid enumrates being generated.
This commit is contained in:
Robert Osfield 2005-11-01 15:39:26 +00:00
parent 4509232792
commit e23176c3b6

View File

@ -206,8 +206,8 @@ void RenderStage::runCameraSetUp(osg::State& state)
_fbo = new osg::FrameBufferObject;
setDrawBuffer(GL_BACK);
setReadBuffer(GL_BACK);
setDrawBuffer(GL_NONE);
setReadBuffer(GL_NONE);
bool colorAttached = false;
bool depthAttached = false;
@ -520,8 +520,6 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
copyTexture(state);
}
state.checkGLErrors("before readPixel;");
if (_image.valid())
{
@ -541,6 +539,7 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
_image->readPixels(_viewport->x(), _viewport->y(),
_viewport->width(), _viewport->height(),
pixelFormat, dataType);
}
@ -550,8 +549,6 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
(*(_camera->getPostDrawCallback()))(*_camera);
}
state.checkGLErrors("before glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);");
if (fbo_supported)
{
// switch of the frame buffer object
@ -560,9 +557,6 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
doCopyTexture = true;
}
state.checkGLErrors("after glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);");
if (fbo_supported && _camera)
{
// now generate mipmaps if they are required.