Opengl mode changing

When you Enable or Disable things like GL_DEPTH_TEST, so this reset values that are linked to the mode like GL_DEPTH_TEST => glDepthFunc()?

eg.

glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glDisable(GL_DEPTH_TEST);
// do some stuff
glEnable(GL_DEPTH_TEST);

will glDepthFunc change it’s value back to the default when i re-enable DEPTH_TEST???

No, it will remain the same until you change it. It will even update to the new value you set even if it’s disabled.

Bob

Ok, Thanks