Skip to main content
gamedev.net
🔒 Locked

glEnable()

Started by Boku San Oct 11, 2004 at 7:48 PM 3 replies 500+ views
Original Post
Boku San
Boku San
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.
Things change.
cmptrgear
cmptrgear
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.
"Pfft, Facts! Facts can be used to prove anything!" -- Homer J. Simpson
Boku San
Boku San
Ah-HA! I KNEW IT!

Thanks for quick response.
Things change.
benjamin bunny
benjamin bunny
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).
Boku San
Boku San
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.
Things change.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.