Skip to content

Instantly share code, notes, and snippets.

@rettuce
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rettuce/0f871f7b017f59550a5e to your computer and use it in GitHub Desktop.
Save rettuce/0f871f7b017f59550a5e to your computer and use it in GitHub Desktop.
openFrameworks SimpleSyphon.app / output Full HD Size webcam.
#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