&& arbFBO != NULL)
{
arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, OpenGl_FrameBuffer::NO_FRAMEBUFFER);
+ SetActiveFrameBuffer (NULL);
}
::glReadBuffer (myReadBuffer);
#else
&& arbFBO != NULL)
{
arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, OpenGl_FrameBuffer::NO_FRAMEBUFFER);
+ SetActiveFrameBuffer (NULL);
}
::glDrawBuffer (aDrawBuffer);
if (arbFBO != NULL && useDefaultFbo)
{
arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, OpenGl_FrameBuffer::NO_FRAMEBUFFER);
+ SetActiveFrameBuffer (NULL);
}
myFuncs->glDrawBuffers (theNb, (const GLenum*)theDrawBuffers);
// Build FBO and setup it as texture
theGlContext->arbFBO->glGenFramebuffers (1, &myGlFBufferId);
theGlContext->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myGlFBufferId);
+ theGlContext->SetActiveFrameBuffer (this);
for (Standard_Integer aColorBufferIdx = 0; aColorBufferIdx < myColorTextures.Length(); ++aColorBufferIdx)
{
// Build FBO and setup it as texture
theGlContext->arbFBO->glGenFramebuffers (1, &myGlFBufferId);
theGlContext->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myGlFBufferId);
+ theGlContext->SetActiveFrameBuffer (this);
for (Standard_Integer aColorBufferIdx = 0; aColorBufferIdx < myColorTextures.Length(); ++aColorBufferIdx)
{
const Handle(OpenGl_Texture)& aColorTexture = myColorTextures (aColorBufferIdx);
// create FBO
theGlCtx->arbFBO->glGenFramebuffers (1, &myGlFBufferId);
theGlCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myGlFBufferId);
+ theGlCtx->SetActiveFrameBuffer (this);
theGlCtx->arbFBO->glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, myGlColorRBufferId);
if (myGlDepthRBufferId != NO_RENDERBUFFER)
{
theGlCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myGlFBufferId);
theGlCtx->SetFrameBufferSRGB (true);
-
theGlCtx->SetActiveFrameBuffer (this);
}
{
theGlCtx->arbFBO->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, myGlFBufferId);
theGlCtx->SetFrameBufferSRGB (true);
+ theGlCtx->SetActiveFrameBuffer (this);
}
// =======================================================================
void OpenGl_FrameBuffer::BindReadBuffer (const Handle(OpenGl_Context)& theGlCtx)
{
theGlCtx->arbFBO->glBindFramebuffer (GL_READ_FRAMEBUFFER, myGlFBufferId);
+ theGlCtx->SetActiveFrameBuffer (this);
}
// =======================================================================
{
theGlCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, NO_FRAMEBUFFER);
theGlCtx->SetFrameBufferSRGB (false);
+ theGlCtx->SetActiveFrameBuffer (NULL);
}
}
{
aCtx->arbFBO->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, 0);
aCtx->SetFrameBufferSRGB (false);
+ aCtx->SetActiveFrameBuffer (NULL);
}
// Render non-polygonal elements in default layer
{
aCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, 0);
aCtx->SetFrameBufferSRGB (false);
+ aCtx->SetActiveFrameBuffer (NULL);
}
// Reset OpenGl aspects state to default to avoid enabling of
{
aCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, OpenGl_FrameBuffer::NO_FRAMEBUFFER);
aCtx->SetFrameBufferSRGB (false);
+ aCtx->SetActiveFrameBuffer (NULL);
}
const Standard_Integer aViewport[4] = { 0, 0, aDrawSizeX, aDrawSizeY };
aCtx->ResizeViewport (aViewport);
}
aCtx->arbFBO->glBindFramebuffer (GL_DRAW_FRAMEBUFFER, OpenGl_FrameBuffer::NO_FRAMEBUFFER);
aCtx->SetFrameBufferSRGB (false);
+ aCtx->SetActiveFrameBuffer (NULL);
}
// we don't copy stencil buffer here... does it matter for performance?
{
aCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, OpenGl_FrameBuffer::NO_FRAMEBUFFER);
aCtx->SetFrameBufferSRGB (false);
+ aCtx->SetActiveFrameBuffer (NULL);
}
}
else