Skip to content

Instantly share code, notes, and snippets.

@moebiussurfing
Last active May 5, 2020 22:27
Show Gist options
  • Save moebiussurfing/ec5d88e47f86e3f0077be45a85c2af1f to your computer and use it in GitHub Desktop.
Save moebiussurfing/ec5d88e47f86e3f0077be45a85c2af1f to your computer and use it in GitHub Desktop.
openFrameworks / ImGui add ofParamaters as c++ types. plain ImGui without ofxImGui
//h
ofParameter<float> _edgeSlope;
//convert string to char pointer
string _str = parameter.getName();
const char * _name(_str.c_str());
/cpp
//setup
_edgeSlope.set("edgeSlope", 0.3f, 0.0f, 1.0f);
//add param as plain ImGui
if (ImGui::SliderFloat("edgeSlope", (float *)&_edgeSlope.get(), _edgeSlope.getMin(), _edgeSlope.getMax()))
{
cout <<_edgeSlope.get()<<endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment