Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

UsefulIdiot

glPushMatrix

This topic is 6546 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!