Commit dd6dd9c0 authored by Clinton Stimpson's avatar Clinton Stimpson

Add PushState/PopState convenience functions.

parent 56511d17
......@@ -124,16 +124,7 @@ void QVTKGraphicsItem::Start()
return;
}
glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);
glPushAttrib(GL_ALL_ATTRIB_BITS);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
mWin->PushState();
mWin->OpenGLInit();
}
......@@ -142,13 +133,7 @@ void QVTKGraphicsItem::End()
if(!mFBO)
return;
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glPopClientAttrib();
glPopAttrib();
mWin->PopState();
mFBO->release();
}
......
......@@ -107,6 +107,30 @@ bool vtkGenericOpenGLRenderWindow::IsCurrent()
return current;
}
void vtkGenericOpenGLRenderWindow::PushState()
{
glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);
glPushAttrib(GL_ALL_ATTRIB_BITS);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
}
void vtkGenericOpenGLRenderWindow::PopState()
{
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glPopClientAttrib();
glPopAttrib();
}
void vtkGenericOpenGLRenderWindow::SetWindowId(void*)
{
......
......@@ -64,6 +64,11 @@ public:
void SetBackRightBuffer(unsigned int);
// }@
//! convenience function to push the state and push/init the tranform matrices
void PushState();
//! convenience function to pop the state and pop the tranform matrices
void PopState();
// {@
//! does nothing
void SetWindowId(void*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment