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
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
//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
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
//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
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
fontSmall.loadFont("Fonts/DIN.otf", 8 ); | |
ofxGuiSetFont( "Fonts/DIN.otf", 8 ); | |
ofxGuiSetDefaultWidth( 260 ); | |
// -------------------------------- | |
void draw() | |
{ | |
// + background | |
ofBackgroundGradient( ofColor(40,40,40), ofColor(0,0,0), OF_GRADIENT_CIRCULAR); |
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
# rm all files | |
git rm -r --cached . | |
# add all files as per new .gitignore | |
git add . | |
# now, commit for new .gitignore to apply | |
git commit -m ".gitignore is now working" |
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
template<typename ParameterType> | |
bool AddParameter(ofParameter<ParameterType>& parameter); | |
//-------------------------------------------------------------- | |
template<typename ParameterType> | |
bool ofxImGui::AddParameter(ofParameter<ParameterType>& parameter) | |
{ | |
auto tmpRef = parameter.get(); |