Last active
August 4, 2020 10:55
-
-
Save moebiussurfing/c3bc5d54d658d9b8375e7c964f8bcd6c to your computer and use it in GitHub Desktop.
openFrameworks / ofParameterGroup save/load parameters settings to xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//h | |
void loadGroup(ofParameterGroup &g, string path); | |
void saveGroup(ofParameterGroup &g, string path); | |
//cpp | |
//-------------------------------------------------------------- | |
void ofApp::loadGroup(ofParameterGroup &g, string path) | |
{ | |
ofLogNotice(__FUNCTION__)<< g.getName() << " to " << path; | |
ofLogVerbose(__FUNCTION__) << "parameters: \n" << g.toString(); | |
ofXml settings; | |
settings.load(path); | |
ofDeserialize(settings, g); | |
} | |
//-------------------------------------------------------------- | |
void ofApp::saveGroup(ofParameterGroup &g, string path) | |
{ | |
ofLogNotice(__FUNCTION__) << g.getName() << " to " << path; | |
ofLogVerbose(__FUNCTION__) << "parameters: \n" << g.toString(); | |
ofXml settings; | |
ofSerialize(settings, g); | |
settings.save(path); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment