From 1202160b57e30ab36452b6f2ff4eaf1d7701040e Mon Sep 17 00:00:00 2001 From: kgv Date: Sun, 1 Sep 2019 13:19:40 +0300 Subject: [PATCH] 0030931: Visualization, TKOpenGl - do not render into GL_FRONT within "GDI Generic" renderer OpenGl_Workspace now disables at initialization time OpenGl_View::SetImmediateModeDrawToFront() property in case of "GDI Generic" OpenGL implementation. OpenGl_View::redrawImmediate() - fixed no buffer swap in case of myTransientDrawToFront without offscreen FBO. --- src/OpenGl/OpenGl_View_Redraw.cxx | 3 ++- src/OpenGl/OpenGl_Workspace.cxx | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/OpenGl/OpenGl_View_Redraw.cxx b/src/OpenGl/OpenGl_View_Redraw.cxx index 5f83913b0d..fd0acf55bb 100644 --- a/src/OpenGl/OpenGl_View_Redraw.cxx +++ b/src/OpenGl/OpenGl_View_Redraw.cxx @@ -817,7 +817,7 @@ bool OpenGl_View::redrawImmediate (const Graphic3d_Camera::Projection theProject OpenGl_FrameBuffer* theOitAccumFbo, const Standard_Boolean theIsPartialUpdate) { - Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext(); + const Handle(OpenGl_Context)& aCtx = myWorkspace->GetGlContext(); GLboolean toCopyBackToFront = GL_FALSE; if (theDrawFbo == theReadFbo && theDrawFbo != NULL) @@ -855,6 +855,7 @@ bool OpenGl_View::redrawImmediate (const Graphic3d_Camera::Projection theProject } else { + toCopyBackToFront = GL_FALSE; myBackBufferRestored = Standard_False; } } diff --git a/src/OpenGl/OpenGl_Workspace.cxx b/src/OpenGl/OpenGl_Workspace.cxx index adfc4902da..c13bcb3cca 100644 --- a/src/OpenGl/OpenGl_Workspace.cxx +++ b/src/OpenGl/OpenGl_Workspace.cxx @@ -146,6 +146,12 @@ OpenGl_Workspace::OpenGl_Workspace (OpenGl_View* theView, const Handle(OpenGl_Wi glHint (GL_LINE_SMOOTH_HINT, GL_FASTEST); glHint (GL_POLYGON_SMOOTH_HINT, GL_FASTEST); + if (myGlContext->Vendor() == "microsoft corporation" + && !myGlContext->IsGlGreaterEqual (1, 2)) + { + // this software implementation causes too slow rendering into GL_FRONT on modern Windows + theView->SetImmediateModeDrawToFront (false); + } #endif }