glPushMatrix and glPopMatrix?

Can somebody do me a favor to tell me:

  1. If I use glPushatrix, how can I make
    a Matrix? I mean, is it an array?
  2. If Matrix is an array, how can I
    retrieve every element in the matrix
    and put them back to the array
    with glPopMatrix?

Thanks a lot and have a nice day!

It’s automatic. glPushMatrix will push the current matrix onto the top of the stack. glPopMatrix takes the top matrix on the stack and makes it the current matrix. There’s no need to get the actual matrix to use these. If you needed the matrix for other reasons, you can get it using glGetFloatfv, but unless you REALLY need to get the matrix, I’d avoid doing that. Getting information back from OpenGL like that works, but you will take a performance hit.