Skip to content

Commit

Permalink
changed to mouse moved reaction
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwohl committed May 10, 2014
1 parent 8ffd7f5 commit 625887f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions osc_video_example/src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void ofApp::update(){
if(m.getAddress() == "/mouse/moved"){
cout << m.getRemoteIp() << " mouse moved to " << m.getArgAsInt32(0) << ", " << m.getArgAsInt32(1) << endl;

mouseClickEffect = ofMap(m.getArgAsFloat(1), 0, ofGetScreenHeight(), 0, 255);
mouseEffect = ofMap(m.getArgAsFloat(1), 0, ofGetScreenHeight(), 0, 255);
}

// example of handling a /mouse/pressed message
Expand Down Expand Up @@ -76,7 +76,7 @@ void ofApp::update(){
int totalPixels = camWidth*camHeight*3;
unsigned char * pixels = vidGrabber.getPixels();
for (int i = 0; i < totalPixels; i++){
videoBytesAltered[i] = pixels[i] + mouseClickEffect;
videoBytesAltered[i] = pixels[i] + mouseEffect;
}
videoTexture.loadData(videoBytesAltered, camWidth,camHeight, GL_RGB);
}
Expand Down
2 changes: 1 addition & 1 deletion osc_video_example/src/ofApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ class ofApp : public ofBaseApp {
ofTexture videoTexture; // a texture in which to display the altered video
int camWidth; // camera width
int camHeight; // camera height
int mouseClickEffect;
int mouseEffect;

};

0 comments on commit 625887f

Please sign in to comment.