Skip to content

Instantly share code, notes, and snippets.

View moebiussurfing's full-sized avatar
🌀

moebiusSurfing moebiussurfing

🌀
View GitHub Profile
@moebiussurfing
moebiussurfing / gist:73953e47d02c7e2bbdb484c42b80d390
Last active February 11, 2020 08:51
openFrameworks - ImGui vec sliders
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);
@moebiussurfing
moebiussurfing / cpp
Created February 11, 2020 05:10
openFrameworks - check if file exists
ofFile file(path);
if (file.exists())
{
}
else
{
ofLogError("ofApp") << "loadSettings '" << path << "' NOT FOUND!";
}
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active February 17, 2020 05:41
openFrameworks - ofxGui theme. check font file exist
//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
{
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active February 17, 2020 05:42
openFrameworks - ofxGui / ofxPanel. customize panels. get from nested groups to minimize/maximize from added ofParameterGroup
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");
@moebiussurfing
moebiussurfing / gist:d40a065da1935bd22a105d58f2b82594
Created February 21, 2020 21:59
openFrameworks - ofParameterGroup
https://forum.openframeworks.cc/t/ofparametergroup-best-practices/18752/16
@moebiussurfing
moebiussurfing / gist:508b1325f72873021ab82e0c99abc66e
Created February 21, 2020 22:01
openFrameworks - ofxImGui NOTES & LINKS
EXAMPLES
https://github.com/MacFurax/ofxImGui
https://github.com/MacFurax/ofxPDSPTools
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active February 24, 2020 04:38
openFrameworks - ofxGuiExtended customize widgets
//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);
@moebiussurfing
moebiussurfing / gist:c5ee135ad6624cf41f43de732b7df65e
Last active October 16, 2020 19:37
openFrameworks ofParameter pointers
//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()
@moebiussurfing
moebiussurfing / ofApp.cpp
Created March 15, 2020 19:38
openFrameworks - simplel color param listener
in ofApp.h
ofParameter<ofColor> color;
void updateModel(ofColor&);
ofEventListener colorListener;
ofApp.cpp
void ofApp::setup(){
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active May 18, 2020 05:34
openFrameworks - bool parameter lambda callback listener: button and toggle
//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;
});