Created
March 15, 2020 19:38
-
-
Save moebiussurfing/6e8e13337db5a76e74d44b7a3ff4888f to your computer and use it in GitHub Desktop.
openFrameworks - simplel color param listener
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(){ | |
//..... | |
gui.add(color.set("color", ofColor(255,0,0,255), ofColor(0,0,0,0), ofColor(255,255,255,255) )); | |
colorListener = color.newListener(this, &ofApp::updateModel); | |
//..... | |
} | |
void ofApp::updateModel(ofColor& c){ | |
//update your model | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment