OpenGL Utility Toolkit

OpenGL Utility Toolkit
OpenGL Utility Toolkit
Developer(s) Mark Kilgard
Operating system Cross-platform

The OpenGL Utility Toolkit (GLUT) is a library of utilities for OpenGL programs, which primarily perform system-level I/O with the host operating system. Functions performed include window definition, window control, and monitoring of keyboard and mouse input. Routines for drawing a number of geometric primitives (both in solid and wireframe mode) are also provided, including cubes, spheres, and the Utah teapot. GLUT also has some limited support for creating pop-up menus.

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

The two aims of GLUT are to allow the creation of rather portable code between operating systems (GLUT is cross-platform) and to make learning OpenGL easier. Getting started with OpenGL programming while using GLUT often takes only a few lines of code and does not require knowledge of operating system–specific windowing APIs.

All GLUT functions start with the glut prefix (for example, glutPostRedisplay marks the current window as needing to be redrawn).

Contents

Implementations

The original GLUT library by Mark Kilgard supports the X Window System (GLX) and was ported to Microsoft Windows (WGL) by Nate Robins. Additionally, Mac OS X ships with a GLUT framework that supports its own NSGL/CGL.

Kilgard's GLUT library is no longer maintained, and its license did not permit the redistribution of modified versions of the library. This spurred the need for free software or open source reimplementations of the API from scratch. The first such library was freeglut, which aims to be a reasonably close reproduction, though introducing a small number of new functions to deal with GLUT's limitations. OpenGLUT, a fork of freeglut, adds a number of new features to the original API, but work on it ceased in May 2005.

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.[1] 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, called glutCheckLoop() (Mac OS X) or glutMainLoopEvent() (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 that glutMainLoop() 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.

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Opengl utility toolkit — GLUT (OpenGL Utility Toolkit) est une bibliothèque utilitaire dont les droits d auteur sont détenus par Mark J. Kilgard, offrant un jeu de routines pour la gestion des fenêtres OpenGL et les interactions avec le système d exploitation (gestion… …   Wikipédia en Français

  • OpenGL Utility Toolkit — GL Utility Toolkit Entwickler Mark Kilgard Aktuelle Version 3.7 (8. Dezember 1998) Betriebssystem plattformunabhängig Kategorie API Lizenz …   Deutsch Wikipedia

  • OpenGL utility toolkit — GLUT (OpenGL Utility Toolkit) est une bibliothèque utilitaire dont les droits d auteur sont détenus par Mark J. Kilgard, offrant un jeu de routines pour la gestion des fenêtres OpenGL et les interactions avec le système d exploitation (gestion… …   Wikipédia en Français

  • OpenGL Utility Toolkit — …   Википедия

  • OpenGL Utility Library — (GLU) ist eine Grafikbibliothek. Aufsetzend auf OpenGL bietet GLU Grafikfunktionen höherer Ebene. Sie ist Teil des OpenGL Pakets. Es existieren drei bedeutende Implementierungen der GLU: Microsoft GLU, in Windows enthalten, implementiert GLU 1.2… …   Deutsch Wikipedia

  • OpenGL Utility Library — The OpenGL Utility Library (GLU) is a computer graphics library. It consists of a number of functions that use the base OpenGL library to provide higher level drawing routines from the more primitive routines that OpenGL provides. It is usually… …   Wikipedia

  • OpenGL — Original author(s) Silicon Graphics Developer(s) Khronos Group Stable release 4.2 …   Wikipedia

  • Opengl — Entwickler: Khronos Group Aktuelle Version: 3.1 (24. März 2009) Betriebssystem: plattformunabhängig Kategorie …   Deutsch Wikipedia

  • Opengl user interface library — (GLUI) est une bibliothèque en C++ qui se combine avec celle de OpenGL utility toolkit (GLUT) et qui fournit diverses routines pour créer l interface d un programme entièrement avec OpenGL. L interface est alors indépendante du système d… …   Wikipédia en Français

  • OpenGL user interface library — (GLUI) est une bibliothèque en C++ qui se combine avec celle de OpenGL utility toolkit (GLUT) et qui fournit diverses routines pour créer l interface d un programme entièrement avec OpenGL. L interface est alors indépendante du système d… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”