1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023188: Regression in SCATexturedShape in SSP sample

OpenGl_View::RedrawLayer2d()
- lighting and 1D/2D texturing disabled so as
not to interfere with layer drawing, layer items should enable
textures if necessary and disable them at the end;
- French comments removed;
- redundant lighting state changes removed

OpenGl_GraphicDriver::BeginLayer()
- useless code enabling 2D textures removed
This commit is contained in:
san 2012-06-05 20:32:09 +04:00
parent a929ed86fb
commit c9d4eb9d4a
2 changed files with 8 additions and 24 deletions

View File

@ -127,9 +127,6 @@ void OpenGl_GraphicDriver::BeginLayer (const Aspect_CLayer2d& ACLayer)
InitLayerProp(ptrLayer->listIndex);
if (!TheLayerProp.ListId) return;
glEnable(GL_TEXTURE_2D);
//GLboolean stat = glIsEnabled( GL_TEXTURE_2D );
glNewList (TheLayerProp.ListId, GL_COMPILE);
TheLayerIsOpen = Standard_True;
}

View File

@ -1300,13 +1300,6 @@ void OpenGl_View::RedrawLayer2d (const Handle(OpenGl_Workspace) &AWorkspace, con
GLsizei dispWidth = (GLsizei )ACLayer.viewport[0];
GLsizei dispHeight = (GLsizei )ACLayer.viewport[1];
const GLboolean isl = glIsEnabled(GL_LIGHTING); /*OCC6247*/
if (isl)
glDisable(GL_LIGHTING); /*OCC6247*/
/*
* On positionne la projection
*/
glMatrixMode( GL_MODELVIEW );
glPushMatrix ();
glLoadIdentity ();
@ -1332,7 +1325,7 @@ void OpenGl_View::RedrawLayer2d (const Handle(OpenGl_Workspace) &AWorkspace, con
ratio = ACView.DefWindow.dx/ACView.DefWindow.dy;
float delta;
if (ratio >= 1.0) { /* fenetre horizontale */
if (ratio >= 1.0) {
delta = (float )((top - bottom)/2.0);
switch (attach) {
case 0: /* Aspect_TOC_BOTTOM_LEFT */
@ -1349,7 +1342,7 @@ void OpenGl_View::RedrawLayer2d (const Handle(OpenGl_Workspace) &AWorkspace, con
break;
}
}
else { /* fenetre verticale */
else {
delta = (float )((right - left)/2.0);
switch (attach) {
case 0: /* Aspect_TOC_BOTTOM_LEFT */
@ -1396,13 +1389,16 @@ void OpenGl_View::RedrawLayer2d (const Handle(OpenGl_Workspace) &AWorkspace, con
glOrtho (left, right, bottom, top, -1.0, 1.0);
/*
* On trace la display-list associee au layer.
*/
glPushAttrib (
GL_LIGHTING_BIT | GL_LINE_BIT | GL_POLYGON_BIT |
GL_DEPTH_BUFFER_BIT | GL_CURRENT_BIT | GL_TEXTURE_BIT );
glDisable (GL_DEPTH_TEST);
glDisable (GL_TEXTURE_1D);
glDisable (GL_TEXTURE_2D);
glDisable (GL_LIGHTING);
// TODO: Obsolete code, the display list is always empty now, to be removed
glCallList (ACLayer.ptrLayer->listIndex);
//calling dynamic render of LayerItems
@ -1415,25 +1411,16 @@ void OpenGl_View::RedrawLayer2d (const Handle(OpenGl_Workspace) &AWorkspace, con
glPopAttrib ();
/*
* On retire la projection
*/
glMatrixMode (GL_PROJECTION);
glPopMatrix ();
glMatrixMode( GL_MODELVIEW );
glPopMatrix ();
/*
* Restauration du Viewport en cas de modification
*/
if (!ACLayer.sizeDependent)
glViewport (0, 0, (GLsizei) ACView.DefWindow.dx, (GLsizei) ACView.DefWindow.dy);
glFlush ();
if (isl)
glEnable(GL_LIGHTING); /*OCC6247*/
}
/*----------------------------------------------------------------------*/