This is a rough overview of one way to set everything up...
1. Create a new Project (command line)
2. Project->Properties->Configuration Properties->Linker->Input->Additional Dependencies
ADD THIS: cg.lib cgGL.lib glew32.lib opengl32.lib glu32.lib glut32.lib
3. I create 3 folders CG, Header Files, and Source file ... but really do what you want here...
To start off, just try hacking the examples given in class.
Cg Syntax Highlighting
WARNING!!! you will be editting your registry
save a copy of it before you do this, and you do this at your own free will,
do not blame me if you mess something up here and your computer does not work.
Registry editting is not for the faint of heart
Want to have colorful syntax highlighting when you edit Cg files in Visual Studio?
The instructions to do this can be seen in your
\NVIDIA Corporation\Cg\msdev_syntax_highlighting\readme.txt file
It covers VS 6 and VS.Net.
Here is what I did for Visual Studio 2005 (Professional Edition):
1. Copy the usertype.dat file to \Microsoft Visual Studio 8\Common7\IDE
2. Open up the registry editor and go to the following location
- HKLM\SOFTWARE\Microsoft\VisualStudio\8.0\Languages\File Extensions
3. Copy the default value from the .cpp key.
4. Create a new key under the File Extensions with the name of .cg
5. Paste the value you just copied into the default value.
6. Restart Visual Studio and your shaders should now have syntax highlighting.
For Visual C++ Express Edition, follow the same steps. In step 2 use the following location:
HKLM\SOFTWARE\Microsoft\VCExpress\8.0\Languages\File Extensions
The usertype.dat file given with the nVidia Cg toolkit has the
highlighting for many Cg keywords missing. You can fix this yourself
just add the words each on a new line in the same file.