OpenGL Utility Toolkit

from Wikipedia, the free encyclopedia
GL Utility Toolkit
Basic data

developer Mark Kilgard
Current  version 3.7
(December 8, 1998)
operating system platform independent
category API
License Proprietary / Mark Kilgard
GLUT

The OpenGL Utility Toolkit ( GLUT ) is an extensive library and collection of OpenGL programs which primarily implement system-level input and output operations of the respective operating system. This toolkit contains functions for defining windows, for controlling these windows and for capturing user input. Functions are also provided that enable the drawing of primitive geometric structures (as wireframes or solid bodies). The structures include cubes, spheres, the Utah Teapot and other geometric shapes based on triangles or squares. In addition, there are slightly limited functions available for creating pop-up menus.

GLUT was originally designed and implemented by Mark J. Kilgard , the author of OpenGL Programming for the X Window System and The Cg Tutorial: The Definitive Guide to Programmable Real-Time Graphics , while at Silicon Graphics Inc.

The two goals of the GL Toolkit were to create the most portable code possible for different platforms and to make it easier to learn OpenGL. Getting started with OpenGL is made much easier by using GLUT, as it hides the peculiarities of the operating system-specific functions through encapsulation. It is possible to implement extensive OpenGL programs with just a few lines and relatively little knowledge.

GLUT is essentially suitable for small to medium-sized projects and offers an interface for the languages C , C ++ , Fortran and Ada .

All GLUT-specific functions always begin with the prefix glut. For example, the call initializes glutInit(&argc, argv);the GLUT system in C ++ and C.

Implementations

Mark Kilgard's original GLUT only supported the X Window System in the form of GLX . It was later ported for Microsoft Windows in the form of WGL and for Mac OS X in the form of NSGL / CGL .

Kilgard's GLUT implementation has not been maintained for a long time and the underlying license does not allow redistribution or a modified form. This led to several complete re-implementations, preferably as open source variants.

The first free implementation freeglut was aiming for a 100% compatible version. It also introduced a few new functions to better correct some of the limitations of the original GLUT version.

The second major re-implementation, openglut, is a fork of the freeglut version and aims to expand the original functionality. However, progress came to a standstill in May 2005.

restrictions

Some of the design decisions of the original GLUT version make it almost impossible for the developer to accomplish certain tasks. This led to a large number of unmentioned and / or unknown patches and enhancements. Some projects even introduce their own re-implementations and corrections.

Some of the known GLUT limitations are as follows:

  • The developer always has to make the call glutMainLoop(), but that call never returns. This behavior makes it almost impossible for developers to use GLUT in programs that want to maintain complete control over their event loops themselves. A common fix for this problem is the introduction of a function (usually glutCheckLoop()called) that only executes a single iteration of the GLUT event loop. Another method that is often used is to move the GLUT event loop to a thread . However, this variant is heavily dependent on the operating system used and often leads to unwanted synchronization problems.
  • The fact that it glutMainLoop()never returns means that an application with GLUT never ends normally. freeglut corrects this problem by introducing the function glutLeaveMainLoop()that glutMainLoop()forces a compliant termination of .
  • GLUT terminates the program or the process when the actual display window is closed. For some applications this can be undesirable behavior. To avoid this problem, some re-implementations introduce an additional callback such as glutWMCloseFunc().

Since the original GLUT version is no longer maintained, it was more or less replaced by the open source version freeglut .

controversy

The different GLUT versions are available in source text form and support a number of platforms. GLUT is neither public domain nor open source and therefore may not be changed, passed on or expanded.

See also

Web links