diff options
Diffstat (limited to 'TRRSS_01_rec/src/testApp.cpp')
| -rwxr-xr-x | TRRSS_01_rec/src/testApp.cpp | 28 |
1 files changed, 27 insertions, 1 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 } //-------------------------------------------------------------- |
