mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0024354: TKOpenGl - location modification of multi-connected shape has no effect when object is drawn by GLSL program
This commit is contained in:
parent
30194ce331
commit
ca1028006d
@ -22,7 +22,8 @@
|
||||
// purpose : Creates new OCCT state
|
||||
// =======================================================================
|
||||
OpenGl_StateInterface::OpenGl_StateInterface()
|
||||
: myIndex (0)
|
||||
: myIndex (0),
|
||||
myNextIndex (1)
|
||||
{
|
||||
//
|
||||
}
|
||||
@ -42,7 +43,9 @@ Standard_Size OpenGl_StateInterface::Index() const
|
||||
// =======================================================================
|
||||
void OpenGl_StateInterface::Update()
|
||||
{
|
||||
++myIndex;
|
||||
myStateStack.Push (myIndex);
|
||||
myIndex = myNextIndex;
|
||||
++myNextIndex;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@ -51,9 +54,14 @@ void OpenGl_StateInterface::Update()
|
||||
// =======================================================================
|
||||
void OpenGl_StateInterface::Revert()
|
||||
{
|
||||
if (myIndex > 0)
|
||||
if (!myStateStack.IsEmpty())
|
||||
{
|
||||
--myIndex;
|
||||
myIndex = myStateStack.Top();
|
||||
myStateStack.Pop();
|
||||
}
|
||||
else
|
||||
{
|
||||
myIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include <OpenGl_Element.hxx>
|
||||
#include <OpenGl_Light.hxx>
|
||||
|
||||
#include <NCollection_Stack.hxx>
|
||||
|
||||
//! Defines interface for OpenGL state.
|
||||
class OpenGl_StateInterface
|
||||
{
|
||||
@ -40,7 +42,9 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
Standard_Size myIndex; //!< Current state index
|
||||
Standard_Size myIndex; //!< Current state index
|
||||
Standard_Size myNextIndex; //!< Next state index
|
||||
NCollection_Stack<Standard_Size> myStateStack; //!< Stack of previous states.
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user