How to get the current state matrix

Hi,

How can I get the current opengl state mechine value(the state matrix), is there any opengl function to get the current matrix? Thanks a lot!

Leo

You mean something like this?

GLdouble projMatrix[16];
GLdouble modelMatrix[16];
glGetDoublev(GL_PROJECTION, projMatrix);
glGetDoublev(GL_MODELVIEW, modelMatrix);

All the glGetXX commands will get you various values depending on what you ask them for…

See this and this

Hi,

How many matrix stacks are used during opengl rendering usually, and What is the initial size of opengl state such as MODELVIEW matrix stack?

Thanks,

leo

These details are all in the docs and specs.
http://www.opengl.org/sdk/docs/man/