View Full Version : Windows vs. Display Lists

07-14-2000, 09:54 PM
Alright, so I have a program with display lists. It uses GLUT to run.

Then, I try to transform the program to run as a Win32 app. I have used NeHe's code, almost to the letter. Here is the code that I am inserting:

GLuint superHandler;

superHandler = glGenLists(1);
if(superHandler == 0)

Well, needless to say it always exits with code 22, because glGenLists returns 0 every time. Anyone know why this happens, or anything that could possibly cause glGenLists to return a zero? I checked, and all the include's and linked libraries match, save for the glut libraries. But, glGenLists, doesn't use glut, right? Any help would be vastly appreciated! Thanks!

07-14-2000, 11:13 PM
Make sure you aren't calling glGenLists() between glBegin()/glEnd() pair.


07-15-2000, 02:46 AM
When you are using GLUT, you don't have to take much care about where you call OpenGL-functions. First, you initialize your window(s) and set callback functions, then you enter the never ending mainloop. GLUT will will then create an OpenGL-context for you, then start calling your functions.

Now, if you write "your own" codebase, you must make sure you actually got a context before you making call to OpenGL, else they will not be processed properly (for example, return 0 when calling glGenLists).

07-15-2000, 12:29 PM
Thanks man. I'll have to give that a try. I was making the glGenList calls in WinMain, before anything else happened. I thought perhaps it was a memory allocation issue... I was too used to the graceful simplicity of GLUT. I guess I'm just not quite in the mindset for this damndable "tip-of-the-iceberg" programing. http://www.opengl.org/discussion_boards/ubb/wink.gif