View Full Version : a way to save opengl default states and restore them

10-05-2005, 07:39 AM
this could be a little bit off-topic, but does anyone know a way how I cn save and restore mos of opengl's states? I know the glpushattrib/glpopattrib stuff, but here is the problem, I want to do the following:

save default
do something
save new states
restore default states
do something
restore new states

best regards,

Mikkel Gjoel
10-05-2005, 12:14 PM
You could always use the gl-getter-functions manually? This would probably be slower than pushattrib, but my guess is you don't have to do this kind of operation very often?

Jens Scheddin
10-05-2005, 12:37 PM
You could write your own class that saves and restores the state.