mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023525: Disappearing of highlight in screenshot
OpenGl immediate mode - get rid from GL display lists Visual3d_TransientManager, Graphic3d_GraphicDriver: removed outdated unused methods to draw primitives in immediate mode. New Draw Harness command to swith rendering mode in immediate mode. When set to false scene will be always redrawn in back buffer. V3d_View::ToPixMap - temporarily switch immediate mode to draw into back buffer Make happy immediate mode dump on OpenGL without FBO (like ms software implementation). OpenGl_Workspace::RedrawImmediatMode - invalidate back buffer when immediate mode drawn into it Added more detailed description for Graphic3d_GraphicDriver::SetImmediateModeDrawToFront method Adding of test case
This commit is contained in:
@@ -169,6 +169,7 @@ To solve the problem (for lack of a better solution) I make 2 passes.
|
||||
|
||||
// S3892
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
|
||||
// S3603
|
||||
#include <Aspect_GenericColorMap.hxx>
|
||||
@@ -3440,8 +3441,9 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap& theImage,
|
||||
const Graphic3d_BufferType& theBufferType,
|
||||
const Standard_Boolean theIsForceCentred)
|
||||
{
|
||||
// always prefer hardware accelerated offscreen buffer
|
||||
Graphic3d_CView* cView = (Graphic3d_CView* )MyView->CView();
|
||||
|
||||
// always prefer hardware accelerated offscreen buffer
|
||||
Graphic3d_PtrFrameBuffer aFBOPtr = NULL;
|
||||
Graphic3d_PtrFrameBuffer aPrevFBOPtr = (Graphic3d_PtrFrameBuffer )cView->ptrFBO;
|
||||
Standard_Integer aFBOVPSizeX (theWidth), aFBOVPSizeY (theHeight), aFBOSizeXMax (0), aFBOSizeYMax (0);
|
||||
@@ -3531,8 +3533,18 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap& theImage,
|
||||
{
|
||||
MyLayerMgr->Compute();
|
||||
}
|
||||
|
||||
// render immediate structures into back buffer rather than front
|
||||
Handle(Graphic3d_GraphicDriver) aDriver = Handle(Graphic3d_GraphicDriver)::DownCast (MyView->GraphicDriver());
|
||||
const Standard_Boolean aPrevImmediateMode = aDriver.IsNull() ? Standard_True : aDriver->SetImmediateModeDrawToFront (*cView, Standard_False);
|
||||
|
||||
Redraw();
|
||||
|
||||
if (!aDriver.IsNull())
|
||||
{
|
||||
aDriver->SetImmediateModeDrawToFront (*cView, aPrevImmediateMode);
|
||||
}
|
||||
|
||||
//szv: restore mapping
|
||||
MyViewMapping = prevMapping;
|
||||
MyView->SetViewMapping (prevMapping);
|
||||
|
Reference in New Issue
Block a user