🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

glPushMatrix

Started by
1 comment, last by UsefulIdiot 24 years ago
I call gl[Push/Pop]Matrix alot and sometimes it leaves an extra matrix or 2 around from the last frame... is there function to kill all matrices in the stack that i dont know about? to save me from calling glPopMatrix a number of times at the end of the frame to make sure i didnt leave any stray pushes. I want this for a safety net to just be sure i got em all.
Advertisement
I think the command you''re searching for doesn''t exist - it would be better to try to write code which calls glPopMatrix() as often as needed.

Visit our homepage: www.rarebyte.de.st

GA
Visit our homepage: www.rarebyte.de.stGA
You could use macros and a global variable to keep track of your matrices stack.

        unsigned int matrixStack = 0;#define PUSH_MATRIX {glPushMatrix(); matrixStack++;};#define POP_MATRIX {glPopMatrix(); matrixStack--;};(do stuff here, pushing and poping matrices, etc.)while (matrixStack) POP_MATRIX        


I think it should do it.

EL

Edited by - Demon Lord on June 22, 2000 3:40:02 PM
----------------------------------------"Inash neteia haeg joa kavari quilm..." SD4

This topic is closed to new replies.

Advertisement