myTransientDrawToFront (Standard_True),
myBackBufferRestored (Standard_False),
myIsImmediateDrawn (Standard_False),
- myUseZBuffer (Standard_False),
- myUseDepthTest (Standard_True),
+ myUseZBuffer (Standard_True),
+ myUseDepthWrite (Standard_True),
myUseGLLight (Standard_True),
myIsCullingEnabled (Standard_False),
myFrameCounter (0),
// request reset of material
NamedStatus |= OPENGL_NS_RESMAT;
- GLbitfield toClear = GL_COLOR_BUFFER_BIT;
- if (myUseZBuffer)
- {
- glDepthFunc (GL_LEQUAL);
- glDepthMask (GL_TRUE);
- if (myUseDepthTest)
- {
- glEnable (GL_DEPTH_TEST);
- }
- else
- {
- glDisable (GL_DEPTH_TEST);
- }
+ myUseZBuffer = Standard_True;
+ myUseDepthWrite = Standard_True;
+ GLbitfield toClear = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT;
+ glDepthFunc (GL_LEQUAL);
+ glDepthMask (GL_TRUE);
+ glEnable (GL_DEPTH_TEST);
- #if !defined(GL_ES_VERSION_2_0)
- glClearDepth (1.0);
- #else
- glClearDepthf (1.0f);
- #endif
- toClear |= GL_DEPTH_BUFFER_BIT;
- }
- else
- {
- glDisable (GL_DEPTH_TEST);
- }
+#if !defined(GL_ES_VERSION_2_0)
+ glClearDepth (1.0);
+#else
+ glClearDepthf (1.0f);
+#endif
if (NamedStatus & OPENGL_NS_WHITEBACK)
{
// set background to white
glClearColor (1.0f, 1.0f, 1.0f, 1.0f);
- toClear |= GL_DEPTH_BUFFER_BIT;
}
else
{
Handle(OpenGl_Workspace) aWS (this);
- if (myUseZBuffer)
- {
- glDepthFunc (GL_LEQUAL);
- glDepthMask (GL_TRUE);
- if (myUseDepthTest)
- {
- glEnable (GL_DEPTH_TEST);
- }
- else
- {
- glDisable (GL_DEPTH_TEST);
- }
-
- #if !defined(GL_ES_VERSION_2_0)
- glClearDepth (1.0);
- #else
- glClearDepthf (1.0f);
- #endif
- }
- else
- {
- glDisable (GL_DEPTH_TEST);
- }
+ myUseZBuffer = Standard_True;
+ myUseDepthWrite = Standard_True;
+ glDepthFunc (GL_LEQUAL);
+ glDepthMask (GL_TRUE);
+ glEnable (GL_DEPTH_TEST);
+#if !defined(GL_ES_VERSION_2_0)
+ glClearDepth (1.0);
+#else
+ glClearDepthf (1.0f);
+#endif
myView->Render (myPrintContext, aWS, theDrawFbo, theProjection,
theCView, theCUnderLayer, theCOverLayer, Standard_True);
if (!myView->ImmediateStructures().IsEmpty())
{
+ myUseZBuffer = Standard_False;
glDisable (GL_DEPTH_TEST);
}
for (OpenGl_IndexedMapOfStructure::Iterator anIter (myView->ImmediateStructures()); anIter.More(); anIter.Next())