PDA

View Full Version : Preserving the value of ONLY ONE OpenGL State ?



08-19-2003, 04:05 PM
when preserving the value of ONLY ONE OpenGL State - GL_BLEND Enable Bit for Example - which is better,
use PushAttrib(GL_ENABLE_BIT), Note that it'll push the value of many other OpenGL States which are not needed.
or use a GLint and do it manualy :

// before changing the value of the stateGLint glBlendIsEnabled = glIsEnabled(GL_BLEND);// some code that's might change the value of GL_BLEND Enable Bit...// after changing the value of the stateif (glBlendIsEnabled) glEnable(GL_BLEND);else glDisable(GL_BLEND);