Detecting actual window creation

When using GLUT to create a window, is there any way to find out exactly when the window creation happens? I need to know as soon as the window has been created and become visible. Is there any way to query GLUT and find out if the window creation is complete?

Also, after a call to glutPostRedisplay(), how do I know exactly when the rendering is actually complete?

I’m working on an app that is meant to run exclusively on Linux.

Thanks in advance.

In your display callback you just set a flag indicating the the rendering is complete.

As for window creation you could use the same thing, once the display callback has been called the first time the window is also visible.

Mikael

Thanks, Mikael, but I’ve already tried that and it doesn’t seem to work. I’ve tried grabbing the contents of the framebuffer after the end of my display callback, and sometimes I get a completely black image. This has happened even when I’m certain that there are no display requests pending. Also, I find that at startup, even after the display callback has finished executing for the first time, the window is not always visible immediately. The latency is too small to detect visually, but any XWindows command involving the newly created window’s Window ID fails unless I allow for an arbitrary delay.

Any further suggestions would be very welcome.