Restore app defaults

Is there a function or other method to restore all the OF internal attributes to their default values? So the app is running and you call things like ofNoFill() or ofEnableAlphaBlending(), is there single function that will just set everything back to defaults?

I have an app that is running Lua scripts (using ofxLua). The scripts are really their own entities, so when I switch to a new script I’d love to be able to just init OF to the default state so the script gets a clean slate.


Should be what you are after.

ofSetupScreen(); could also be useful for resetting window/screen properties.

I prefer the following push/pop methods whenever I use color, fill, etc… I think it’s a less known OF function. But, It’s really a time saver as push/popMatrix() methods;


Thanks @theo just what I was looking for and it seems to be working nicely.

Also thanks @alp that is a good tip.