glPush och glPop?
I''m wondering what you have the glPush and glPop commands for... i heard they are pretty useful =)... ?
There''s glPushAttrib and glPushMatrix
The matrix one saves the current matrix on the stack. This means that it makes a "backup" of the current matrix. Then you can continue working as normal, and once you need back that backup, you glPopMatrix
Attribs work the same way, so if you don''t know whether eg lighting is on or off, and you want to turn it off, but once you''re done return it to the original state, you glPushAttrib(GL_LIGHTING_BIT), then glDisable( GL_LIGHTING ), do the drawing, then glPopAttrib
The matrix one saves the current matrix on the stack. This means that it makes a "backup" of the current matrix. Then you can continue working as normal, and once you need back that backup, you glPopMatrix
Attribs work the same way, so if you don''t know whether eg lighting is on or off, and you want to turn it off, but once you''re done return it to the original state, you glPushAttrib(GL_LIGHTING_BIT), then glDisable( GL_LIGHTING ), do the drawing, then glPopAttrib
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement