Last active
August 29, 2015 14:14
-
-
Save rettuce/0f871f7b017f59550a5e to your computer and use it in GitHub Desktop.
Revisions
-
rettuce renamed this gist
Jan 29, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ #include "ofMain.h" #include "ofxSyphon.h" -
rettuce created this gist
Jan 29, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ #include "ofMain.h" #include "ofxSyphon.h" const unsigned int WIDTH = 1920; const unsigned int HEIGHT = 1080; class ofApp : public ofBaseApp { ofVideoGrabber video; ofxSyphonServer mainOutputSyphonServer; public: ofApp(){} void setup() { ofSetFrameRate(60); ofEnableSmoothing(); ofBackground(0); video.initGrabber(WIDTH,HEIGHT,true); // mainOutputSyphonServer.setName("webcam"); } void update() { video.update(); mainOutputSyphonServer.publishTexture(&video.getTextureReference()); } void draw() { video.draw(0, 0, WIDTH*0.1,HEIGHT*0.1); ofDrawBitmapString(ofToString(ofGetFrameRate()), WIDTH*0.1-60, 10); } void keyPressed(int key){}; void keyReleased(int key){}; void mouseMoved(int x, int y ){}; void mouseDragged(int x, int y, int button){}; void mousePressed(int x, int y, int button){}; void mouseReleased(int x, int y, int button){}; void windowResized(int w, int h){}; }; #include "ofAppGLFWWindow.h" int main(int argc, const char** argv) { ofAppGLFWWindow window; ofSetupOpenGL(&window, WIDTH*0.1, HEIGHT*0.1, OF_WINDOW); ofRunApp(new ofApp); return 0; }