You don't need to call
nite::UserTracker::readFrame() and wait for it to return each time you want to read a frame of data from
nite::UserTracker. This is because NiTE developers give us this ability to define a callback (also known as event listener) when a new frame becomes available, just as
openni::VideoStream does. In this recipe, we are going to cover this feature and rewrite the first recipe of this chapter, this time based on events.
Create a project in Visual Studio and prepare it for working with OpenNI and NiTE using the Create a project in Visual Studio 2010 recipe in Chapter 2, OpenNI and C++.
Add these lines after the definition of the