PDA

View Full Version : VC++ newbie Q



02-07-2000, 08:42 AM
I'm just getting started in OpenGl, and I want to write in VC++ can anyone tell me what enviroment variables I need to set or do I only need to put the proper include statements in my programs?

Gorg
02-07-2000, 09:06 AM
You need to link your project with those libraries :

opengl32.lib, glu32.lib, glaux.dll.

for the include statement :

windows.h, gl.h, glu.h, glaux.h

MikeC
02-07-2000, 09:38 AM
Um... Gorg's info is fine, but glaux is generally considered obsolete these days. Most people use GLUT instead, which has the added benefit of being cross-platform. It also comes with LOTS of examples.

To get started with OpenGL/GLUT in MSVC:

1. Create a project for a console app.

2. Link with glut32.lib, glu32.lib, opengl32.lib

3. Include "glut.h" - this includes gl.h and glu.h, and should be enough to get you started. You DON'T need "windows.h"

You should be able to find links to GLUT on the main OpenGL site; if you have problems just drop me a line.

gvili r
02-08-2000, 02:40 AM
The most important thing : The windows.h include must come before all *gl include

MikeC
02-08-2000, 04:04 AM
The most important thing : The windows.h include must come before all *gl include

No, not with GLUT. GLUT (at least the current version, 3.7) defines all Windows-specific macros used by gl.h/glu.h

There are only 2 or 3 of these macros, so including the whole of windows.h is massive overkill, and the other 58 billion symbols it defines will just clutter up your namespace.