mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +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:
@@ -48,6 +48,7 @@
|
||||
#include <V3d_Viewer.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <Visual3d_View.hxx>
|
||||
|
||||
extern Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theName,
|
||||
const Handle(AIS_InteractiveObject)& theAISObj,
|
||||
@@ -194,8 +195,6 @@ void VUserDrawObj::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||
glPopAttrib();
|
||||
}
|
||||
|
||||
|
||||
|
||||
OpenGl_Element* VUserDrawCallback(const CALL_DEF_USERDRAW * theUserDraw)
|
||||
{
|
||||
Handle(VUserDrawObj) anIObj = (VUserDrawObj*)theUserDraw->Data;
|
||||
@@ -395,6 +394,44 @@ static int VFeedback (Draw_Interpretor& theDI,
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
//function : VImmediateFront
|
||||
//purpose :
|
||||
//==============================================================================
|
||||
|
||||
static int VImmediateFront (Draw_Interpretor& theDI,
|
||||
Standard_Integer theArgNb,
|
||||
const char** theArgVec)
|
||||
{
|
||||
// get the context
|
||||
Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext();
|
||||
if (aContextAIS.IsNull())
|
||||
{
|
||||
std::cerr << "No active view. Please call vinit.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(Graphic3d_GraphicDriver) aDriver =
|
||||
Handle(Graphic3d_GraphicDriver)::DownCast (aContextAIS->CurrentViewer()->Device()->GraphicDriver());
|
||||
if (aDriver.IsNull())
|
||||
{
|
||||
std::cerr << "Graphic driver not available.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (theArgNb < 2)
|
||||
{
|
||||
//theDI << "VBO: " << aDriver->ToUseVBO() << "\n";
|
||||
//return 0;
|
||||
std::cerr << "Wrong number of arguments.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Graphic3d_CView* aCView = (Graphic3d_CView* )(ViewerTest::CurrentView()->View()->CView());
|
||||
aDriver->SetImmediateModeDrawToFront (*aCView, atoi(theArgVec[1]) != 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : OpenGlCommands
|
||||
//purpose :
|
||||
@@ -410,4 +447,8 @@ void ViewerTest::OpenGlCommands(Draw_Interpretor& theCommands)
|
||||
theCommands.Add("vfeedback",
|
||||
"vfeedback : perform test GL feedback rendering",
|
||||
__FILE__, VFeedback, aGroup);
|
||||
theCommands.Add("vimmediatefront",
|
||||
"vimmediatefront : render immediate mode to front buffer or to back buffer",
|
||||
__FILE__, VImmediateFront, aGroup);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user