Unofficial OpenGL Software Development Kit
0.5.0
|
#include <MatrixStack.h>
RAII-style object for pushing/popping MatrixStack objects.
The constructor of this object pushes a MatrixStack, and its destructor will pop it. This technique is called RAII; it ensures that, in the event of exceptions or other similar circumstances, the matrix stack will be pushed and popped. More importantly, if you add an early return statement in a block that didn't have one, you don't have to worry about the stack being in a malformed state.
This object cannot be copied, so it cannot be returned from another function or otherwise passed around. And you shouldn't pass it around by reference.
Public Member Functions | |
PushStack (MatrixStack &stack) | |
Pushes the given MatrixStack. | |
~PushStack () | |
Pops the MatrixStack that the constructor was given. | |
void | ResetStack () |
Resets the current matrix of the MatrixStack to the value that was pushed in the constructor. More... | |
|
inline |
Resets the current matrix of the MatrixStack to the value that was pushed in the constructor.
This does not alter the stack depth. It just resets the matrix.