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); |
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
ImGui::CreateContext(); | |
ImGuiIO& io = ImGui::GetIO(); | |
io.Fonts->AddFontFromFileTTF(&ofToDataPath("ofxPresetsManager/fonts/overpass-mono-bold.otf")[0], 12.0f); | |
gui.setup(); |
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
//split string path using boost | |
//https://stackoverflow.com/questions/10099206/howto-parse-a-path-to-a-vector-using-c | |
//boost::filesystem::path p1("/usr/local/bin"); | |
boost::filesystem::path p1(videoFilePath.get()); | |
//boost::filesystem::path p2("c:\\"); | |
std::cout << p1.filename() << std::endl; // prints "bin" | |
std::cout << p1.parent_path() << std::endl; // prints "/usr/local" | |
videoName = ofToString(p1.filename()); | |
filename: "NightmoVES4.mov" |
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
//group | |
ofAddListener(params.parameterChangedE(), this, &ofxGpuLutCube::Changed_params); | |
//toggle | |
ofEventListener listener; | |
listener = SHOW_CONTROL.newListener([this](bool b) { | |
OSC_Helper.setVisiblePlots(b); | |
//std::cout << b << std::endl; | |
}); |
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
in ofApp.h | |
ofParameter<ofColor> color; | |
void updateModel(ofColor&); | |
ofEventListener colorListener; | |
ofApp.cpp | |
void ofApp::setup(){ |
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
//pass parameter as reference? | |
//https://forum.openframeworks.cc/t/its-posible-to-pass-reference-to-an-ofparameter-float-as-a-simple-c-float-type/34301 | |
ofParameter<float> fParam; | |
ofxPrintMyVars::addFloat("myFloat", (float*)&fParam.get()); | |
//- | |
ofApp.cpp | |
setup() |
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
//ofxGuiExtended | |
gui_VideoFx = gui.addGroup(params_GuiPanel); | |
//group folding with group names bc by default name is not showed | |
gFrag1 = gui_VideoFx->addGroup("FRAG1"); | |
gFrag2 = gui_VideoFx->addGroup("FRAG2"); | |
gFrag3 = gui_VideoFx->addGroup("FRAG3"); | |
gFrag1->add(frag1.parameters); |
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
EXAMPLES | |
https://github.com/MacFurax/ofxImGui | |
https://github.com/MacFurax/ofxPDSPTools |
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
https://forum.openframeworks.cc/t/ofparametergroup-best-practices/18752/16 |
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
void ofxFontAnimator::refreshGui_AllColors() | |
{ | |
//gui_All_Colors.minimizeAll(); | |
//collapse groups | |
auto &gAll = gui_All_Colors.getGroup("ALL COLORS"); | |
auto &gF = gAll.getGroup("FONTS"); | |
auto &gBg = gAll.getGroup("BACKGROUNDS"); | |
auto &gGr = gBg.getGroup("GRADIENT BACKGROUND"); |