Cg Toolkit Cg 3.1 Toolkit Documentation
Cg / Topics / glut

Topic

glut - using Cg with the OpenGL Utility Toolkit (GLUT)

Abstract

GLUT provides a cross-platform window system API for writing OpenGL examples and demos. For this reason, the Cg examples packaged with the Cg Toolkit rely on GLUT.

Windows Installation

The Cg Toolkit installer for Windows provides a pre-compiled 32-bit (and 64-bit if selected) versions of GLUT. GLUT is provided both as a Dynamic Link Library (DLL) and a static library.

The GLUT DLL is called glut32.dll and requires linking against glut32.lib. These 32-bit versions are typically installed at:

c:\Program Files\NVIDIA Corporation\Cg\bin\glut32.dll
c:\Program Files\NVIDIA Corporation\Cg\lib\glut32.lib

The 64-bit (x64) versions are installed at:

c:\Program Files\NVIDIA Corporation\Cg\bin.x64\glut32.dll
c:\Program Files\NVIDIA Corporation\Cg\lib.x64\glut32.lib

As with any DLL in Windows, if you link your application with the GLUT DLL, running your application requires that glut32.dll can be found when executing GLUT.

Alternatively you can link statically with GLUT. This can easily be done by defining the GLUT_STATIC_LIB preprocessor macro before including GLUT's <GL/glut.h> header file. This is typically done by adding the -DGLUT_STATIC_LIB option to your compiler command line. When defined, a #pragma in <GL/glut.h> requests the linker link against glutstatic.lib instead of glut32.lib.

The 32-bit and 64-bit versions of the GLUT static library are installed at:

c:\Program Files\NVIDIA Corporation\Cg\lib\glutstatic.lib
c:\Program Files\NVIDIA Corporation\Cg\lib.x64\glutstatic.lib

See Also

TBD


Cg Toolkit | Cg Toolkit | Download | Release Archive | Profiles | Reference | Books | Discussions |


Cg Topics

cg1_2_runtime_changes
Cg
glut
mac
trace
win64