Getting OpenGL working in C++


I’m trying to get a basic Open GL shape to run in a C++ Metrowerks program. I’ve tried using both C++ Console Apps and Win32C++ Apps as a basis for the program (I don’t know anything about windowing in C++) and have added what I need for Open GL. The programs compile and link but when they run I simply get the initial “HelloWorld” screen. I’m sure that what I’ve done is really silly. Has anyone got any suggestions?


When you say you’ve added everything you need for OpenGL, what do you mean specifically? If you mean you set the pixelformat of a window to support OpenGL, or added glut initialization, then your OpenGL code should work fine. If you didn’t do either of these (as I suspect is the case) then you need to. You can find the “Red Book” online somewhere, which gives all its examples using glut. (Sorry, I don’t know the link offhand, I have a hard copy.) You can also check the Nehe tutorials for examples of how to create a window that supports OpenGL without using Glut. (