glut subwindow problem

Hi,

I’m having a problem creating glut subwindows.
I can only draw in the last subwindow created?!

The windows are created correctly. I gave them a different glClearColor and they all show up in that color but only the last created window shows my object (the different render callbacks call the same main render code).

Any thoughts on what I could be doing wrong?

glutCreateSubwindow returns a window id right after you created the subwindow, it will be used for gl drawing, but if you want to draw to a formerly created subwindow, you have to use glutSetWindow(int) with the respective window id.