Skip to content

Instantly share code, notes, and snippets.

View moebiussurfing's full-sized avatar
🛴

moebiusSurfing moebiussurfing

🛴
View GitHub Profile
@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 / 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 April 22, 2020 04:39
openFrameworks - file path handling with boost
//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"
@moebiussurfing
moebiussurfing / ofApp.cpp
Created April 28, 2020 00:47
openFrameworks - ofxImGui customize font
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.Fonts->AddFontFromFileTTF(&ofToDataPath("ofxPresetsManager/fonts/overpass-mono-bold.otf")[0], 12.0f);
gui.setup();
@moebiussurfing
moebiussurfing / cute & cool dark colors grid
Last active May 1, 2020 03:10
openFrameworks - example: cool colors grid
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);
# 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"
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active May 5, 2020 22:27
openFrameworks / ImGui add ofParamaters as c++ types. plain ImGui without ofxImGui
//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);
@moebiussurfing
moebiussurfing / ofApp.cpp
Last active May 5, 2020 22:28
openFrameworks / template for parameter types / ofxImGui example
template<typename ParameterType>
bool AddParameter(ofParameter<ParameterType>& parameter);
//--------------------------------------------------------------
template<typename ParameterType>
bool ofxImGui::AddParameter(ofParameter<ParameterType>& parameter)
{
auto tmpRef = parameter.get();