Last active
August 29, 2015 14:14
-
-
Save rettuce/0f871f7b017f59550a5e to your computer and use it in GitHub Desktop.
openFrameworks SimpleSyphon.app / output Full HD Size webcam.
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
#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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment