
Welcome to the Cg 2.0 stand-alone example source code distribution!

September 21, 2007

Here you will find a collection of Cg examples written for both OpenGL and
Direct3D (DirectX 9).  This collection of example code will be expanded
in the future.  Suggestions are welcome.

To use this source code, make sure you have the latest version of the
Cg Toolkit from http://developer.nvidia.com/object/cg_toolkit.html

Cg 1.5 or later is recommended for basic examples.  Some advanced
examples require Cg 2.0.

You will find 4 categories of example code:

OpenGL/basic:

   Find in this directory ANSI C source code for 18 OpenGL-based example
   applications demonstrating the use of Cg programs found in "The Cg
   Tutorial".

   In the future, this directory will have 27 example applications from
   "The Cg Tutorial".

   For information about the Cg programs, refer to their discussion in
   "The Cg Tutorial".

OpenGL/advanced:

   Find in this directory ANSI C source code for 13 OpenGL-based
   advanced example applications.  cgfx_bumpdemo demonstrates loading
   effects from CgFX files.  cgfx_procfx demonstrates Cg 1.5's new
   API for procedurally generating effects.  gs_-prefixed examples
   demonstrate geometry shaders.

Direct3D9/basic:

   Find in this directory C++ source code for 7 Direct3D9-based example
   applications demonstrating the use of Cg programs found in "The
   Cg Tutorial".  These Direct3D examples match the OpenGL/basic examples.

Direct3D9/advanced:

   Find in this directory Visual Studio C++ source code for 1
   Direct3D9-based advanced example application.  cgfx_bumpdemo
   demonstrates loading effects from CgFX files.

Solutions and projects for various Visual Studio versions (Visual C++ 6.0,
Visual Studio .NET 2003, Visual Studio 2005) are included for Windows
users.  The Visual Studio 2005 projects provide x64 configurations for
building 64-bit versions of the examples.  You need a 64-bit version
of the Windows operating system (such as 64-bit Windows XP) to run the
64-bit examples.

There are also Makefiles for GNU make provided for the OpenGL examples.
Use these Makefiles for Linux, Mac OS X, and Solaris systems.  These
Makefiles can also work on Windows systems with the Cygwin Linux-like
enviornment for Windows (http://www.cygwin.com/) installed for those
without Visual Studio.

The OpenGL examples require an OpenGL implementation with extensions
programmable shading.

The Direct3D examples only build for Windows platforms.  To build the
Direct3D examples, you will need the Microsoft DirectX SDK installed.
Download the latest version from http://msdn.microsoft.com/directx/sdk/
The DXSDK_DIR environment variable (set by the DirectX SDK installer)
is used to locate the necessary DirectX headers and libraries.  To run
the Direct3D examples, you must have the DirectX 9 runtime installed.

