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
static float position[] = {0.0f, 0.0f}; | |
ImGui::SliderFloat2("position", position, -1.0f, 1.0f); | |
static glm::vec3 myVector{0.0f, 0.0f, 0.0f}; | |
ImGui::SliderFloat3("myVector", (float*)&myVector, 0.0f, 1.0f); | |
static ImVec4 myImVector{1.0f, 1.0f, 1.0f, 1.0f}; | |
ImGui::SliderFloat4("myImVector", (float*)&myImVector, 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
ofFile file(path); | |
if (file.exists()) | |
{ | |
} | |
else | |
{ | |
ofLogError("ofApp") << "loadSettings '" << path << "' NOT FOUND!"; | |
} |
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
//ofxGui theme | |
string path = GLOBAL_Path + "fonts/overpass-mono-bold.otf"; | |
ofFile file(path); | |
if (file.exists()) | |
{ | |
ofLogNotice("ofxSceneTEST") << "ofxGui theme: LOADED FONT FILE '" << path << "'"; | |
ofxGuiSetFont(path, 9); | |
} | |
else | |
{ |
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"); |
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
//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
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
//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; | |
}); |