We will use Microsoft Visual C++ 2010 Express for compiling the PhysX program. It is freely available at www.microsoft.com. We have to include the PhysX library files and header files in VC++ Directories that can be found at View | Property Pages. Property Pages can also be modified from Property Manager. A Property Manager window enables us to modify project settings that are defined in property sheets. A project property sheet is basically an .xml
file that is used to save project configurations and can also be applied to multiple projects because it is inheritable.
Configuring VC++ 2010 Express requires the following steps:
After downloading the PhysX 3.x SDK for the Windows platform, which comes in a ZIP file, you need to extract it to any preferred location on your PC. For this book, we will extract the PhysX SDK's ZIP file to
C:\dev
. Finally, our PhysX SDK location will look likeC:\dev\PhysX-3.3.0_PC_SDK_Core
.Before including the PhysX library files and header files in Property Manager, we first need to create a new Visual C++ Win32 Console application. To do this, open your MS VC++ compiler from the toolbar and navigate to File | New | Project. Then, a New Project window will pop up. Select Win32 Console Application and also provide Name and Location for the project. Finally, click on the OK button to proceed further as shown in the following screenshot:
Soon after, a Win32 Application Wizard window will pop up. Here, click on the Next button to get the Application Settings screen, where you need to make sure that the Empty project option is checked under Additional options. Finally, click on the Finish button as shown in the following screenshot:
Next, we need to configure our project's VC++ directories so that it can find the PhysX SDK header files and libraries that are required for compiling the PhysX program. We will include the absolute path for PhysX SDK Include Directories and Library Directories. To do this in VC++ 2010 Express, navigate to View | Property Manager. If the Property Manager option is not visible there, navigate to Tools | Settings and select Expert Settings; this will enable the Property Manager option in View. In the Property Manager window, double-click on a configuration-and-platform node, for example, Debug | Win32 or Release | Win32, as shown in the following screenshot:
Double-clicking on a configuration-and-platform node, such as Debug | Win32 or Release | Win32, will open Property pages for the respective node configuration, such as, Debug Property Pages or Release Property Pages. This can also be opened by navigating to View | Property pages.
When configuration-specific Property Pages (namely Debug Property Pages or Release Property Pages) will pop up, select VC++ Directories and add the following entries:
Select Include Directories and then click on <Edit...> to add
C:\dev\PhysX-3.3.0_PC_SDK_Core\Include
.Select Library Directories and then click on <Edit...> to add
C:\dev\PhysX-3.3.0_PC_SDK_Core\Lib\win32
(for a 32-bit platform) orC:\dev\PhysX-3.3.0_PC_SDK_Core\Lib\win64
(for a 64-bit platform).
Finally, click on the OK button to save your changes and close the window.
These PhysX SDK directory settings are saved on a per user basis and not on per project basis. So whenever you create a new VC++ project in VC++ 2010 Express, PhysX directories will automatically be added to your Include Directories
project. We are now finally done with the PhysX configuration in VC++ 2010 Express. In the next chapter, we will create our first PhysX program.