how to set the window to be __glutcurrentwindow

After I have created the window and write some off-screen rendering code,I get the real trouble in letting the glutdisplayfunc()
working because of there is no __glutcurrentwindow?
Thanks for your help in advance!

glutCreasteWindow() and glutCreateSubWindow() return window IDs. Set the current window with glutSetWindow, passing the window ID as the parameter.

You can establish callback routines per window by setting the current window, then calling glutDisplayFunc(), glutReshapeFunc(), etc.

But I really do not want to create the window by using the glut function because of the off-screen rendering , so I create the window at first, then … then I get the trouble because I want to use the glutdisplayfunc() again, how can I do then?

GLUT is not designed to work with windows that you do not create through the GLUT interface. Hasve you seen this done before? What makes you think it would work?

Your best bet here would be to hack the GLUT source.