c# - How to restart a Kinect -


so i'm writing xna app using kinect sdk , when game changes game screen screen, stop kinect using

sensor.stop(); sensor.dispose(); 

and while work has considerable lag , makes game unresponsive @ least 10 seconds. after screen go game screen again different settings. use

//set event handlers sensor.blahstream += myfunction; sensor.start(); 

is best way restart kinect?

just fiddled around more, putting stopping on separate thread seems work.

stopgamethread = new thread(new parameterizedthreadstart(stopgame)); stopgamethread.start(); 

that calls method:

void stopgame(object sender) {     gscreen.sensor.stop();     gscreen.sensor.dispose();     running = false; } 

gscreen game screen contained in game screen wrapper.

if has better answers feel free post them.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -