Not sure but glPushAttrib and glPopAttrib might be able to help, I havnt got time to check atm.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_68iq.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc03_68iq.asp