Chapter 2. Creating Your First Program
We have already introduced how to install
the Kinect device on Windows in the previous chapter, as well as some official examples showing the basic concepts of Kinect programming. In this chapter, we will prepare a simple OpenGL framework for our Kinect-based game using the C++ language. OpenGL is a well-rounded and evolving cross-platform API for rendering 2D and 3D graphics. It supports multiple languages including C/C++, Java, Python, and C#. As we are working on an Augmented Reality (AR) project, which must consist of the view of the real world and some virtual elements, OpenGL will be a good choice here because of its hardware-accelerated features and popularity all over the world.
Tip
As you may know, Microsoft's DirectX is another reliable 2D/3D graphics API that could fit our requirements. But it is only used under Windows currently, and can hardly support languages except C/C++ and C#. You can learn more about DirectX at:
Also, we have discussed about the installation of Kinect for the Windows SDK in the previous chapter. The SDK provides us libraries and header files for use in the official toolkits and our own applications. To make use of the SDK, we will have to include the header files and link to the necessary libraries in our projects to generate the final executables.
To note, this is not a Kinect API reference book, so we can't list and introduce all the functions and structures here. You can refer to the following website for more information about the Kinect NUI API:
http://msdn.microsoft.com/en-us/library/hh855366.aspx
Before starting to create a C++ project, you should at least have a C++ compiler. For Windows users, the Visual Studio product is always a better choice. You can download Visual C++ 2012 Express for free from:
http://www.microsoft.com/visualstudio/eng/downloads#d-2012-express
It is assumed that you are already familiar with this environment, as well as the C++ language and OpenGL programming. You can refer to the following link for details about the OpenGL API and related resources at http://www.opengl.org/.