Equivalent to glPushAttrib()

Hello, is there a way to do the same thing that the openGL command glPushAttrib() does ?

Because I have this problem : I draw an object without texture then I draw a second object with a texture. When my screen is updated (second call to my display function), my first object becomes textured !!

Thanks for your help.

No, there is no such equivalent. You need to keep track of the render states you set and make sure you disable texturing if it was previously enabled when you want to render an untextured object.

Thanks

Although you can’t call glPushAttrib, you can still preserve the state using glIsEnabled()

Eg, you could do:

GLboolean was_enabled = glIsEnabled (GL_TEXTURE_2D);

/* do something that might disable/enable texturing */

if (was_enabled)
  glEnable (GL_TEXTURE_2D);
else
  glDisable (GL_TEXTURE_2D);

I imagine it is best to track the GL states on your own instead of calling any glGet or glIs function.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.