Last active
May 5, 2020 22:27
-
-
Save moebiussurfing/ec5d88e47f86e3f0077be45a85c2af1f to your computer and use it in GitHub Desktop.
openFrameworks / ImGui add ofParamaters as c++ types. plain ImGui without ofxImGui
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 | |
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