This tutorial shows you how to get started with Frontend using Visual C++ 2008 Express Edition on Windows.
Installing and configuring
Before we can create our own Frontend-applications we must install some software and set up the development environment.
Installing Visual C++ 2008 Express Edition
To make life a whole lot easier, we are going to start by installing a nice IDE for C++. As you probably know, IDE means Integrated Development Environment and is a complete kit with code-editor, compiler, linker and debugger. Currently, the best free IDE on the Windows-platform is Visual C++ 2008 Express Edition, and therefore our Windows-tutorials will be based on this IDE.
You can download Visual Studio 2008 Express Edition here.
There is already written a nice guide on how to install those on the Microsoft website. Just click this link and read their guide, and you’ll probably manage this on your own. :)
Installing CG Toolkit
Frontend allows you to use several shading languages. The most versatile is nVidia Cg, which can be used both on both OpenGL and DirectX implementations. This is an optional step, as you don’t need Cg to use Frontend. However, most of the tutorials on this site will use Cg shaders as examples. Send your browser to nVidia’s website to get the CG Toolkit. Scroll down to almost the bottom, where you see their Install Packages, and download the Windows-version. The installation should be pretty straight forward.
Installing DirectX SDK (optional, but is needed for building Frontend libraries)
This is also an optional step, as it is only necessary if you want to use the DirectX-implementations of Frontend. Since most of our tutorials will be based on the GL/CG-implementation its no problem to skip this step. But sure, if you want a complete system you’ll want the DirectX SDK as well. You can download the DirectX SDK here.
Installing Frontend
Now that you have the IDE and third-party SDK’s installed and ready it’s time to get your hands on the OpenFrontend SDK. Head over to the Download section and read the download instructions there. The most convenient way to install Frontend is to use a SVN client (like TortoiseSVN). This way you can keep the SDK in a folder and just right click on it and say “SVN Update” to get patched up to the latest version at any time. For the rest of the tutorial, we will assume that you checked out the repository in C:\frontend-svn\.
You can download TortoiseSVN here. When installed, you can make a new folder, e.g. frontend-svn on C:\. Then simply right-click the folder and press “SVN Checkout.”
Enter the repository url and your user account, and you will soon have the current revision of Frontend at your fingertips.
Adding Cg Toolkit, DirectX and Frontend paths to VC++ Directories
We will now add the Cg Toolkit, DirectX and Frontend include and lib paths to the Visual Studio default paths so they can be easily accessed from all projects using them.
Open the Options-dialog from the Tools-menu, expand Projects and Solutions, and select VC++ Directories.
From the drop down-list at the right, select Include-files.
Then add a new line and browse for each of the below include folders:
- C:\frontend-svn\trunk\openfrontend\include
- C:\frontend-svn\trunk\frontend2\include
- C:\frontend-svn\trunk\frontend2utils\include
- C:\Program Files\NVIDIA Corporation\Cg\include (based on where you installed Cg Toolkit)
- C:\Program Files\Microsoft DirectX SDK (November 2008)\Include (based on where you installed the DirectX SDK)
Now select Library-files from the drop down-list, and add each of the below lib folders:
- C:\frontend-svn\trunk\openfrontend\lib
- C:\frontend-svn\trunk\frontend2\lib
- C:\frontend-svn\trunk\frontend2utils\lib
- C:\Program Files\NVIDIA Corporation\Cg\lib (based on where you installed Cg Toolkit)
- C:\Program Files\Microsoft DirectX SDK (November 2008)\Lib\x86 (based on where you installed the DirectX SDK)
Now VC++ knows where to find the Cg Toolkit, DirectX and Frontend library files and source files when compiling and linking your program, and we are ready to compile the Frontend libraries.
Building Frontend
Next, we need to compile the Frontend libraries. Open the folder C:/frontend-svn/trunk/openfrontend/projects/vc9 and launch the file openfrontend.sln. On the Build menu select “Batch Build…”. Press the “Select all” button to select all configurations and press “Rebuild”. This can take a while. When done, close Visual Studio and repeat the process for “frontend2utils.sln”.
Now VC++ knows where to find the Frontend-files when compiling and linking your program, and we are finally done with the install and configure-part; once and for all! Because when everything is installed and configured properly we can create as many projects as we like without needing to do this all over again for every project. :)