mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-19 13:40:49 +03:00
0025438: Visualization, TKOpenGl - always setup viewport within OpenGl_Workspace::Redraw()
This commit is contained in:
@@ -640,14 +640,16 @@ void OpenGl_Workspace::Redraw (const Graphic3d_CView& theCView,
|
||||
aGlCtx->FetchState();
|
||||
|
||||
Tint toSwap = (aGlCtx->IsRender() && !aGlCtx->caps->buffersNoSwap) ? 1 : 0; // swap buffers
|
||||
GLint aViewPortBack[4];
|
||||
OpenGl_FrameBuffer* aFrameBuffer = (OpenGl_FrameBuffer* )theCView.ptrFBO;
|
||||
if (aFrameBuffer != NULL)
|
||||
{
|
||||
glGetIntegerv (GL_VIEWPORT, aViewPortBack);
|
||||
aFrameBuffer->SetupViewport (aGlCtx);
|
||||
toSwap = 0; // no need to swap buffers
|
||||
}
|
||||
else
|
||||
{
|
||||
aGlCtx->core11fwd->glViewport (0, 0, myWidth, myHeight);
|
||||
}
|
||||
|
||||
myToRedrawGL = Standard_True;
|
||||
if (theCView.RenderParams.Method == Graphic3d_RM_RAYTRACING
|
||||
@@ -721,7 +723,7 @@ void OpenGl_Workspace::Redraw (const Graphic3d_CView& theCView,
|
||||
{
|
||||
aFrameBuffer->UnbindBuffer (aGlCtx);
|
||||
// move back original viewport
|
||||
glViewport (aViewPortBack[0], aViewPortBack[1], aViewPortBack[2], aViewPortBack[3]);
|
||||
aGlCtx->core11fwd->glViewport (0, 0, myWidth, myHeight);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(HAVE_VIDEOCAPTURE)
|
||||
|
Reference in New Issue
Block a user