glutCreateWindow - Man Page
Create a new top-level window
OpenGLUT - window
glutCreateWindow(const char* title);
Title for created window
This function sends a request for a window to be constructed. OpenGLUT immediately constructs a data structure to track further events with the window, on the theory that eventually the window manager will get back to us with a real window. This allows us to begin registering callbacks immediately.
In fact, you
register a display callback via glutDisplayFunc() before you enter glutMainLoop().
For onscreen windows, you should not depend upon the window concretely existing or being visibile until you are told that it exists and is visible via a registered callback.
The return value is an
It should be positive for valid windows or 0 if failure occurred for some reason (Though traditional GLUT tends to bail out and abort rather than returning errors.) The integer is your
. Old GLUT promises that these integers are ``small''; we do not reuse old
s, but do produce them sequentially.
You can change the title later via glutSetWindowTitle().
glutDestroyWindow(3) glutCreateSubWindow(3) glutSetWindowTitle(3) glutCreateMenuWindow(3)
glutCreateMenuWindow(3), glutCreateSubWindow(3), glutDestroyWindow(3), glutInit(3), glutPopWindow(3), glutPostWindowRedisplay(3), glutSetWindowTitle(3).