Thursday, May 28, 2009

Using opengl, glut, and cg with Visual Studio

These pages describe the process (the first one is out of date, but the changes to directory structure are minor):

OpenGL and GLUT
Cg

In case those pages go away, it boils down to this:

GLUT

  • Get GLUT for Win32

  • Copy...


    • glut32.dll to %WinDir%\System

    • glut32.lib to $(VSDir)\VC\lib

    • glut.h to $(VSDir)\include\GL


  • ...where $(VSDir) is something like C:\Program Files\Microsoft Visual Studio 9.0\VC


Cg


Visual Studio

  • Make a new Win32 Console Application project: File->New Project->Visual C++->Win32->Win32 Console Application

    • In the "Application Settings" page of the wizard, make sure Application type is Console Application and Empty project (under Additional options) is checked.

  • Go to Project->(project name) Settings


    • Set Configuration to All Configurations

    • Expand Configuration Properties

    • In C/C++->General, add $(CG_INC_PATH) to Additional Include Directories

    • In Linker->General, add $(CG_LIB_PATH) to Additional Library Directories

    • In Linker->Input, add opengl32.lib glu32.lib glut32.lib cg.lib cgGL.lib to Additional Dependencies


No comments: