OpenGLEAN
OpenGLEAN User Support
Home page | Introduction | Documentation | Files | Examples | Proposals | Authors | Links


OpenGLEAN Development
Summary | CVS | (discussion via home page) | (contact via home page) | (suggestion box) | License | Todo | Bugs

Colormap Management
[OpenGLEAN API Reference]

Collaboration diagram for Colormap Management:


Functions

void glutCopyColormap (int window)
GLfloat glutGetColor (int color, int component)
void glutSetColor (int nColor, GLfloat red, GLfloat green, GLfloat blue)

Detailed Description

GLUT defined support for pseudo-color display modes (color-mapped). freeglut provided non-working stub support. OpenGLUT inherited that from freeglut.

In the first few days of 2005, OpenGLEAN implemented colormap support.


Function Documentation

void glutCopyColormap int  window  ) 
 

Copies a color map between windows.

Parameters:
window The window to copy to
Allows you to copy an entire color map from one window to another. This function copies from the current window. It copies to the indicated window. Respects the current layer setting.

It does not set the current window

It is a fatal error either to call this function without properly initializing OpenGLEAN via glutInit() or to call this function without a current window.

Note:
There is no GLUT API for copying a color map into a cache, so if you (e.g.) want to change lots of colors very quickly, you either need to loop over glutSetColor(), or create a color-mapped window on the side.

Obviously should do nothing for non-colormapped windows.

See also:
glutSetColor(), glutGetColor()
Todo:
Determine if we should set the current window

Test.

WIN32 version.

Here is the call graph for this function:

GLfloat glutGetColor int  color,
int  component
 

Gets an indexed color-mode entry's Red, Green, or Blue value.

Parameters:
color The palette entry to fetch.
component Whether to fetch Red, Green, or Blue.
Allows you to get individual color-map entries in a GLUT_INDEX type of display. Respects the current layer setting. Works on the current window.

component may be any of:

  • GLUT_RED
  • GLUT_GREEN
  • GLUT_BLUE

It is a fatal error either to call this function without properly initializing OpenGLEAN via glutInit() or to call this function without a current window.

Note:
Obviously should do nothing for non-colormapped windows.
See also:
glutSetColor(), glutCopyColorMap()
Todo:
Untested.

WIN32 version.

void glutSetColor int  nColor,
GLfloat  red,
GLfloat  green,
GLfloat  blue
 

Sets an indexed color-mode entry.

Parameters:
nColor The palette entry to change.
red New red value for palette entry.
green New green value for palette entry.
blue New blue value for palette entry.
glutSetCursor() allows you to set individual color-map entries in a GLUT_INDEX type of display. Uses the current window. Respects the current overlay setting.

The minimum and maximum range for nColor is not well defined at this time.

red, green, and blue are values as for glColor3f().

It is a fatal error either to call this function without properly initializing OpenGLEAN via glutInit() or to call this function without a current window.

Note:
Obviously should do nothing for non-colormapped windows.
See also:
glutGetColor(), glutCopyColorMap()
Todo:
Error checking.

Testing.

WIN32 version.

Bug:
Probably should clone the root window's color map to start.




SourceForge.net Logo Supported in part by SourceForge.net.

Generated on Fri Sep 16 20:15:38 2005 for OpenGLEAN by doxygen 1.4.3
The OpenGLEAN project is hosted by olib.org and SourceForge.