Configuring Visual Studio 2010 to use OpenGL
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.
Getting ready
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 working with OpenGL easier. You can download the GLUT library and header files from this website or use the glut.zip
file in this chapter's downloadable content. Unfortunately, the official site offers 32-Bit binaries only which can be downloaded...