Last active
May 18, 2020 06:07
-
-
Save moebiussurfing/5baab13bc0375e528dab507513f73a51 to your computer and use it in GitHub Desktop.
openFrameworks - ofParameterGroup cast parameters from group callback
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
ofApp::Changed_params(ofAbstractParameter &e) | |
{ | |
//bool | |
if (e.type() == typeid(ofParameter<bool>).name()) | |
{ | |
ofParameter<bool> b = e.cast<bool>(); | |
if (name == "BANG_1") | |
{ | |
if (b) | |
{ | |
ofLogNotice("ofApp") << "\t\t\t\t" << name << " !"; | |
} | |
} | |
if (name == "BANG_2") | |
{ | |
if (b) | |
{ | |
ofLogNotice("ofApp") << "\t\t\t\t" << name << " !"; | |
} | |
} | |
} | |
if(e.type() == typeid(ofParameter<int>).name()) | |
{ | |
ofParameter<int> p = e.cast<int>(); | |
... | |
} | |
else if(e.type() == typeid(ofParameter<float>).name() | |
{ | |
ofParameter<float> p = e.cast<float>(); | |
... | |
} | |
else if(e.type() == typeid(ofParameter<ofVec3f>).name() | |
{ | |
ofParameter<ofVec3f> p = e.cast<ofVec3f>(); | |
... | |
} | |
ofParameter<float> aProp = e.getFloat("opacity"); | |
ofParameter<float> prop = e.cast<float>(); | |
if (name == "Name") | |
{ | |
string _name = e.cast<string>(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment