Skip to content

Instantly share code, notes, and snippets.

@moebiussurfing
Last active May 18, 2020 06:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moebiussurfing/5baab13bc0375e528dab507513f73a51 to your computer and use it in GitHub Desktop.
Save moebiussurfing/5baab13bc0375e528dab507513f73a51 to your computer and use it in GitHub Desktop.
openFrameworks - ofParameterGroup cast parameters from group callback
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