As we need to show the result of the color, IR, and/or depth sensors to the user, we must use an interface. Here we choose to use OpenGL to show data to the user because it is multiplatformed and you can convert your code to other platforms easily later on, if you want to. OpenNI's samples use OpenGL too. But you can also go for DirectX or other types of interfaces capable of displaying 2D images, such as Graphics Device Interface (GDI).
Follow this recipe to add OpenGL to a Microsoft Visual Studio 2010 C++ project.
Create and configure a project using the Creating a project in Visual Studio 2010 recipe of Chapter 2, Open NI and C++.
In this recipe we used the OpenGL Utility Toolkit to make ...