Limitations
Some of GLUT's original design decisions made it hard for programmers to perform desired tasks. This led many to create non-canon patches and extensions to GLUT. Some free software or open source reimplementations also include fixes.
Some of the more notable limitations of the original GLUT library include:
- The library requires programmers to call
glutMainLoop
, a function which never returns. This makes it hard for programmers to integrate GLUT into a program or library which wishes to have control of its own event loop. A common patch to fix this is to introduce a new function, calledglutCheckLoop
(Mac OS X) orglutMainLoopEvent
(freeglut/OpenGLUT), which runs only a single iteration of the GLUT event loop. Another common workaround is to run GLUT's event loop in a separate thread, although this may vary by operating system, and also may introduce synchronization issues or other problems: for example, the Mac OS X GLUT implementation requires thatglutMainLoop
be run in the main thread. - The fact that
glutMainLoop
never returns also means that a GLUT program cannot exit the event loop. freeglut fixes this by introducing a new function,glutLeaveMainLoop
. - The library terminates the process when the window is closed; for some applications this may not be desired. Thus, many implementations include an extra callback, such as
glutWMCloseFunc
.
Since it is no longer maintained (essentially replaced by the open source freeglut) the above design issues are still not resolved in the original GLUT.
Read more about this topic: OpenGL Utility Toolkit
Famous quotes containing the word limitations:
“Growing up means letting go of the dearest megalomaniacal dreams of our childhood. Growing up means knowing they cant be fulfilled. Growing up means gaining the wisdom and skills to get what we want within the limitations imposed by realitya reality which consists of diminished powers, restricted freedoms and, with the people we love, imperfect connections.”
—Judith Viorst (20th century)
“To note an artists limitations is but to define his talent. A reporter can write equally well about everything that is presented to his view, but a creative writer can do his best only with what lies within the range and character of his deepest sympathies.”
—Willa Cather (18761947)
“The motion picture made in Hollywood, if it is to create art at all, must do so within such strangling limitations of subject and treatment that it is a blind wonder it ever achieves any distinction beyond the purely mechanical slickness of a glass and chromium bathroom.”
—Raymond Chandler (18881959)