I’m a fairly experienced UN*X programmer trying to pick up OpenGL from the 5th edition superbible using VisualStudio 2008 on Windows (so … dealing with new windows things in addition to dealing with OpenGL…)
The first program to try is in the 2nd chapter — it’s going to put a triangle in a window — I appreciate the simplicity of a “hello world” program. For those that don’t have it, the superbible is using GLEW and and GLUT as it’s helper libraries.
The program is simple enough, and I even used the copy from the web (in case my own typing was not accurate enough). It compiles, but it crashes.
There are two issues that I’m fighting. The first is that glewInit() is returning a ‘1’ … which matches a “GL version error” and the second is that returning from main() or calling exit(1) causes atexit() calls in glut that dereference null pointers (bad form).
The 2nd issue isn’t really preventing my fun — it’s just a comment. The first issue, however, is preventing my fun.
Now… I’ve read a lot about windows and OpenGL. I’m using win7/64 and I have an nVidia 275 card installed with the 260.99 drivers. The OpenGL extension probe software (available somewhere on this site) lists OpenGL 3.2 as available.
Is GLEW not really a good idea? The superbible seems to be really recently published… so it seems wierd that it’s examples would already be broken.