Next: 8.1 glutSetColor Up: GLUT APIversion 3 Previous: 7.19 glutTimerFunc

# 8 Color Index Colormap Management

OpenGL supports both RGBA and color index rendering. The RGBA mode is generally preferable to color index because more OpenGL rendering capabilities are available and color index mode requires the loading of colormap entries.

The GLUT color index routines are used to write and read entries in a window's color index colormap. Every GLUT color index window has its own logical color index colormap. The size of a window's colormap can be determined by calling `glutGet(GLUT_WINDOW_COLORMAP_SIZE)`.

GLUT color index windows within a program can attempt to share colormap resources by copying a single color index colormap to multiple windows using `glutCopyColormap`. If possible GLUT will attempt to share the actual colormap. While copying colormaps using `glutCopyColormap` can potentially allow sharing of physical colormap resources, logically each window has its own colormap. So changing a copied colormap of a window will force the duplication of the colormap. For this reason, color index programs should generally load a single color index colormap, copy it to all color index windows within the program, and then not modify any colormap cells.

Use of multiple colormaps is likely to result in colormap installation problems where some windows are displayed with an incorrect colormap due to limitations on colormap resources.

- 8.1 glutSetColor
- 8.2 glutGetColor
- 8.3 glutCopyColormap

Next: 8.1 glutSetColor Up: GLUT APIversion 3 Previous: 7.19 glutTimerFunc