[HOpenGL] Re: Exiting gracefully from (H)GLUT?

Sven Panne Sven.Panne@informatik.uni-muenchen.de
Sun, 14 Apr 2002 15:28:01 +0200


Wolfgang Thaller wrote:

> C. Reinke wrote:
>>[...] I found that I
>>had to move the call to genLists after createWindow.
>>
> I'd expect that, because most (all?) versions of GLUT don't initialize the
> OpenGL context until the window has actually been created. [...]


Exactly, I just had a look in the GLUT sources. So the general rule of thumb is:

    Issue OpenGL calls *after* the first createWindow, never before.

This makes sense perfectly: Remember that you could have multiple Windows,
so the effect of e.g. setting the current to color depends on the current
GLX/OpenGL context. The latter one is created with createWindow, changed
with e.g. setWindow, overlay handling, etc. etc.

Cheers,
    S.