summaryrefslogtreecommitdiff
path: root/gui/src/ofApp.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2017-12-29 03:36:45 +0000
committerTim Redfern <tim@getdrop.com>2017-12-29 03:36:45 +0000
commit4c9570bdf49ec3a6517e5be60fc960d7d9cdbed0 (patch)
treeeb4278452a7f67a30bc6341f7df8b0d6e1fe98be /gui/src/ofApp.cpp
parentb470c73bfc271c032f4df9a3fd1b9770cf627f00 (diff)
syphon output
Diffstat (limited to 'gui/src/ofApp.cpp')
-rw-r--r--gui/src/ofApp.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/gui/src/ofApp.cpp b/gui/src/ofApp.cpp
index cbfb139..d28fe70 100644
--- a/gui/src/ofApp.cpp
+++ b/gui/src/ofApp.cpp
@@ -43,6 +43,22 @@ void ofApp::setup(){
sets[1].init();
commandPressed=false;
+
+ //syphon
+ bSmooth = false;
+ ofSetWindowTitle("ofxSyphon Example");
+
+ mainOutputSyphonServer.setName("Screen Output");
+ //individualTextureSyphonServer.setName("Texture Output");
+
+ //mClient.setup();
+
+ //using Syphon app Simple Server, found at http://syphon.v002.info/
+ //mClient.set("","Simple Server");
+
+
+ ofSetFrameRate(60); // if vertical sync is off, we can go a bit fast... this caps the framerate at 60fps.
+
}
//--------------------------------------------------------------
@@ -74,9 +90,16 @@ void ofApp::draw(){
}
void ofApp::drawOutput(ofEventArgs & args){
- ofBackground(0,0,0);
+ // Clear with alpha, so we can capture via syphon and composite elsewhere should we want.
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (bSmooth){
+ ofEnableSmoothing();
+ }
+
for (int i=0;i<sets.size();i++){
#ifdef GPU_ALGORITHM
@@ -97,6 +120,7 @@ void ofApp::drawOutput(ofEventArgs & args){
next_update=ofGetElapsedTimef()+0.1f;
}
+ mainOutputSyphonServer.publishScreen();
}