Skip to content

OpenGL Display Lists And Sub Windows

by Dan on March 6th, 2010

I recently discovered after some needless frustration, that you need to declare display lists that contain model drawing information in all windows in which you wish to draw the model. For example, if I say:

glutSetWindow(main_window);
initDisplayLists();
...
void main_display()
{
   drawDisplayList();
}

It will work just fine. But if I try to do the same in a display function of the sub window it won’t draw. You need to call whatever init() function you create your models / display lists in AFTER setting the window. For example

glutSetWindow(main_window);
// do stuff

glutSetWindow(sub_window);
initDisplayLists();
...

void sub_display()
{
    drawDisplayList();
}

Hope that helps someone out there!

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS