summaryrefslogtreecommitdiff
path: root/TRRSS_01_rec
diff options
context:
space:
mode:
Diffstat (limited to 'TRRSS_01_rec')
-rwxr-xr-xTRRSS_01_rec/src/testApp.cpp28
-rwxr-xr-xTRRSS_01_rec/src/testApp.h10
2 files changed, 36 insertions, 2 deletions
diff --git a/TRRSS_01_rec/src/testApp.cpp b/TRRSS_01_rec/src/testApp.cpp
index c43fd2d..ddd543f 100755
--- a/TRRSS_01_rec/src/testApp.cpp
+++ b/TRRSS_01_rec/src/testApp.cpp
@@ -49,12 +49,20 @@ void unbindTex(ofTexture &tex) {
}
//--------------------------------------------------------------
void testApp::setup(){
+#ifdef NEWAPI
+ openNIDevice.setup();//FromXML("openni/config/ofxopenni_config.xml");
+ openNIDevice.setLogLevel(OF_LOG_VERBOSE);
+ openNIDevice.addDepthGenerator();
+ openNIDevice.addImageGenerator(); // comment this out
+ openNIDevice.start();
+#else
recordContext.setup();
recordDepth.setup(&recordContext);
recordImage.setup(&recordContext);
recordUser.setup(&recordContext);
recordUser.setUseCloudPoints(true);
recordContext.toggleRegisterViewport();
+#endif
guiWin=new guiWindow();
ofxFenster* win=ofxFensterManager::get()->createFenster(0, 0, 200, 400, OF_WINDOW);
@@ -65,14 +73,26 @@ void testApp::setup(){
//--------------------------------------------------------------
void testApp::update(){
+#ifdef NEWAPI
+ openNIDevice.update();
+#else
recordContext.update();
recordDepth.update();
recordImage.update();
recordUser.update();
+#endif
}
//--------------------------------------------------------------
void testApp::draw(){
+#ifdef NEWAPI
+ ofSetColor(255, 255, 255);
+
+ //openNIDevice.drawDebug(); // draws all generators
+ //openNIDevice.drawDepth(0, 0);
+ openNIDevice.drawImage(0, 0,ofGetWidth(),ofGetHeight());
+#else
+
//cam.begin();
//bind texture recordImage
//get point data from recordDepth
@@ -151,8 +171,14 @@ void testApp::draw(){
//recordImage.draw(0, 0, ofGetWidth(),ofGetHeight());
//cam.end();
+#endif
-
+}
+
+void testApp::exit(){
+#ifdef NEWAPI
+ openNIDevice.stop();
+#endif
}
//--------------------------------------------------------------
diff --git a/TRRSS_01_rec/src/testApp.h b/TRRSS_01_rec/src/testApp.h
index 00316b0..3f11572 100755
--- a/TRRSS_01_rec/src/testApp.h
+++ b/TRRSS_01_rec/src/testApp.h
@@ -15,6 +15,8 @@
#include "ofxMayaCam.h"
+#define NEWAPI true
+
class guiWindow;
class testApp : public ofxFensterListener{
@@ -23,6 +25,7 @@ class testApp : public ofxFensterListener{
void setup();
void update();
void draw();
+ void exit();
void keyPressed (int key);
void keyReleased(int key);
@@ -34,10 +37,15 @@ class testApp : public ofxFensterListener{
void dragEvent(ofDragInfo dragInfo);
void gotMessage(ofMessage msg);
+#ifdef NEWAPI
+ ofxOpenNI openNIDevice;
+#else
ofxOpenNIContext recordContext;
ofxDepthGenerator recordDepth;
- ofxImageGenerator recordImage;
+ ofxImageGenerator recordImage;
ofxUserGenerator recordUser;
+#endif
+
guiWindow *guiWin;