All Topics  
OpenGL Utility Toolkit

 

   Email Print
   Bookmark   Link






 

OpenGL Utility Toolkit



 
 
The OpenGL
OpenGL

OpenGL is a standard specification defining a cross-language cross-platform Application programming interface for writing applications that produce 2D computer graphics and 3D computer graphics....
 Utility Toolkit
Widget toolkit

A widget toolkit, widget library, or GUI toolkit is a set of GUI widget for use in designing applications with graphical user interfaces ....
 (GLUT) is a library of utilities for OpenGL programs, which primarily perform system-level I/O
Input/output

In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world ? possibly a human, or another information processing system....
 with the host operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
. 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, sphere
Sphere

A sphere is a symmetrical geometrical object. In non-mathematical usage, the term is used to refer either to a round ball or to its two-dimensional surface....
s, and the Utah teapot
Utah teapot

The Utah teapot or Newell teapot is a 3D computer graphics model which has become a standard reference object in the computer graphics community....
. GLUT even has some limited support for creating pop-up menus.

GLUT was written by Mark J. Kilgard
Mark Kilgard

Mark J. Kilgard is a graphics software engineer working at Nvidia.Prior to joining Nvidia, Mark worked at Compaq and Silicon Graphics. While at Silicon Graphics, he authored the OpenGL Utility Toolkit, better known as GLUT, to make it easy to write OpenGL-based 3D examples and demos....
, 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
Silicon Graphics

Silicon Graphics, Inc. is a company manufacturer high-performance computing solutions, including computer hardware and computer software. SGI was founded by James H....
 Inc.

The two aims of GLUT are to allow the creation of rather portable code between operating systems (GLUT is cross-platform
Cross-platform

In computing, cross-platform is a term used to refer to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms....
) and to make learning OpenGL easier.






Discussion
Ask a question about 'OpenGL Utility Toolkit'
Start a new discussion about 'OpenGL Utility Toolkit'
Answer questions from other users
Full Discussion Forum



Encyclopedia


The OpenGL
OpenGL

OpenGL is a standard specification defining a cross-language cross-platform Application programming interface for writing applications that produce 2D computer graphics and 3D computer graphics....
 Utility Toolkit
Widget toolkit

A widget toolkit, widget library, or GUI toolkit is a set of GUI widget for use in designing applications with graphical user interfaces ....
 (GLUT) is a library of utilities for OpenGL programs, which primarily perform system-level I/O
Input/output

In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world ? possibly a human, or another information processing system....
 with the host operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
. 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, sphere
Sphere

A sphere is a symmetrical geometrical object. In non-mathematical usage, the term is used to refer either to a round ball or to its two-dimensional surface....
s, and the Utah teapot
Utah teapot

The Utah teapot or Newell teapot is a 3D computer graphics model which has become a standard reference object in the computer graphics community....
. GLUT even has some limited support for creating pop-up menus.

GLUT was written by Mark J. Kilgard
Mark Kilgard

Mark J. Kilgard is a graphics software engineer working at Nvidia.Prior to joining Nvidia, Mark worked at Compaq and Silicon Graphics. While at Silicon Graphics, he authored the OpenGL Utility Toolkit, better known as GLUT, to make it easy to write OpenGL-based 3D examples and demos....
, 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
Silicon Graphics

Silicon Graphics, Inc. is a company manufacturer high-performance computing solutions, including computer hardware and computer software. SGI was founded by James H....
 Inc.

The two aims of GLUT are to allow the creation of rather portable code between operating systems (GLUT is cross-platform
Cross-platform

In computing, cross-platform is a term used to refer to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms....
) 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 API
Application programming interface

An application programming interface is a set of subroutine, data structures, class and/or Protocol provided by library and/or operating system Service s in order to support the building of applications....
s.

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

Implementations


The original GLUT library by Mark Kilgard supports the X Window System
X Window System

The X Window System is a computing software system and network protocol that provides a graphical user interface for networked computers. It implements the X Window System protocols and architecture and provides windowing system on raster graphics Visual display units and manages Keyboard and pointing device control functions....
 (GLX
GLX

GLX provides the Binding connecting OpenGL and the X Window System: it enables programs wishing to use OpenGL to do so within a window provided by the X Window System....
) and was ported to Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 (WGL
WiggleWin32

WGL or Wiggle is the windowing system interface to the Microsoft Windows implementation of the OpenGL specification. WGL is analogous to GLX, which is the X11 interface to OpenGL as well as Core OpenGL, which is the Mac OS X interface to OpenGL....
) by Nate Robins. Additionally, Mac OS X
Mac OS X

Mac OS X is a line of computer operating systems developed, marketed, and sold by Apple Inc., and since 2002 has been included with all new Macintosh computer systems....
 ships with a GLUT framework that supports its own CGL
Core OpenGL

Core OpenGL, or CGL, is Apple Inc.'s Macintosh Quartz windowing system interface to the Mac OS X implementation of the OpenGL specification....
.

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
Free software

Free Software or software libre is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also do these things and to prevent consumer-facing hardware...
 or open source
Open source

Open source is an approach to design, development, and distribution offering practical accessibility to a product's source . Some consider open source as one of various possible design approaches, while others consider it a critical Strategy element of their business operations....
 reimplementations of the API from scratch. The first such library was freeglut
Freeglut

freeglut open source alternative to the OpenGL Utility Toolkit library. GLUT allows the user to create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard and joystick functions....
, which aims to be a fairly exact clone, though introducing a small number of new functions to deal with GLUT's limitations. , a fork of freeglut, adds a number of new features to the original API, but is no longer under active development.

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
Free software

Free Software or software libre is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also do these things and to prevent consumer-facing hardware...
 or open source
Open source

Open source is an approach to design, development, and distribution offering practical accessibility to a product's source . Some consider open source as one of various possible design approaches, while others consider it a critical Strategy element of their business operations....
 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, often called glutCheckLoop, 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
    Synchronization (computer science)

    In computer science, synchronization refers to one of two distinct but related concepts: synchronization of process , and synchronization of data....
     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
    Freeglut

    freeglut open source alternative to the OpenGL Utility Toolkit library. GLUT allows the user to create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard and joystick functions....
     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 OpenSource freeglut
Freeglut

freeglut open source alternative to the OpenGL Utility Toolkit library. GLUT allows the user to create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard and joystick functions....
) the above design issues are still not resolved in the original GLUT. In a web page description of the glutMainLoop problem, one programmer claimed that Kilgard was opposed to integrating fixes.

See also

  • OpenGL Utility Library (GLU)
  • OpenGL User Interface Library (GLUI)
  • freeglut
    Freeglut

    freeglut open source alternative to the OpenGL Utility Toolkit library. GLUT allows the user to create and manage windows containing OpenGL contexts on a wide range of platforms and also read the mouse, keyboard and joystick functions....
  • Simple DirectMedia Layer
    Simple DirectMedia Layer

    Simple DirectMedia Layer is a cross-platform, free and open source software multimedia Library written in C that presents a simple interface to various platforms' computer graphics, sound, and input devices, allowing a developer to write a Personal computer game or other multimedia application that can run on many operating systems includi...
  • GEMS
    Generic Eclipse Modeling System

    Generic Eclipse Modeling System is a configurable toolkit for creating domain-specific modeling and program synthesis environments for Eclipse ....


External links

  • (found from ARToolKit
    ARToolKit

    ARToolKit is a computer vision tracking library that allows for the creation of augmented reality applications that overlay virtual imagery on the real world....
     readme)