Context: TOC -> GLUT/Tk Overview
Details: Installation, Application Programming Interface, Application Development

GLUT/Tk Overview

GLUT/Tk was written by the Visualization and Usability Group.

Purpose and Scope

While OpenGL provides comprehensive, efficient, and portable support for 3D output, it does not support other features typical of real-life 3D applications. These include: The GLUT system, developed by Mark Kilgard and enhanced for Windows by Nate Robins, addresses some of these requirements, but the provided menu system is rather rudimentary.

The Tcl/Tk system is of course a widely available full-featured menu system.

GLUT/Tk integrates these two very successful and portable systems: GLUT for portable 3D graphics, and Tcl/Tk for the development of sophisticated GUIs. Although both of these were originally developed under X windows and Unix, they now both offer a Windows version as well.

GLUT/Tk is a "light-weight" system that seeks to leverage GLUT and Tcl/Tk by tying them together in a stylistically consistent way with the addition of only a few commands to each. As a result, developers can code 3D applications, including graphical input, windows, and menus, that will port easily between Unix-based systems and Windows-based systems. Furthermore, there should be at most a negligible performance penalty, since the purely graphical operations are still programmed directly in OpenGL.

Implementation Strategy

The basic implementation strategy is to enable a GLUT process to launch an independent Tk script. Thus, the built-in event loops of these two systems can operate as usual and the resulting programming style (registering callbacks for given events) is unchanged.

The independent processes then send messages back and forth. To the GLUT process, the Tcl process appears to be just another input device (like the mouse and keyboard), and the API is written to conform to this model. The GLUT process can also send certain events back to the Tcl process that simulate button presses of selected menu widgets. (Terminology note: we will refer to an interactive subwindow of the Tk window as a tk-button and reserve the simple term button for the part of the mouse that your finger presses.) This latter capability is useful for implementing shortcut keystrokes.

Spaceball bonus

Six degree-of-freedom (6 DOF) devices are especially imporant for user interaction with 3D applications, and so GLUT's support for the Spaceball device has been updated.

Valid HTML 4.01! Page last modified: 12 February 2003