Jump to content
  • Advertisement
Sign in to follow this  
Boku San

glEnable()

This topic is 5392 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

Are glEnable()/glDisable() calls universal? I mean, if you use a glPushMatrix(), does it only save current coordinates, or does it save settings as well? I'm writing a test application, and it seems that glPushMatrix() only stores coordinates, not what's enabled/disabled at the moment. Thanks in advance for responses, just want to know if it's bad coding or one of the APIs quirks.

Share this post


Link to post
Share on other sites
Advertisement
glPushMatrix only saves the contents of the translation/rotation/scaling matrix (hence the name pushmatrix)

openGL is a big state machine so calling glEnable/glDisable switches various settings on and off, so if you call glEnable it stays enabled until you call glDisable on it.

Share this post


Link to post
Share on other sites
You seem to have misunderstood what glPushMatrix does. glPushMatrix pushes the current matrix onto the appropriate matrix stack. That's it. (edit: cmptrgear beat me to it)

glPushAttrib is probably more what you're after (see the docs).

Share this post


Link to post
Share on other sites
Quote:
Original Post by benjamin bunny
You seem to have misunderstood what glPushMatrix does. glPushMatrix pushes the current matrix onto the appropriate matrix stack. That's it.

glPushAttrib is probably more what you're after (see the docs).


Okay, I didn't know that. The funny part is, I have the blue book right here, and the term right before glPushMatrix happens to be glPushAttrib...so, uh, my bad.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!