View3D Functions


Visual and Colormap Functions

The following functions are used to select and create the visual and colormap for a View3D widget..

Function NameDescription
XintGlAllocateColormapAllocates a colormap for a specifed visual.
XintGlChooseVisualChooses a visual compatible with OpenGL.


XintGlAllocateColormap

This function allocates a colormap for the specified visual. In the case where no visual has been specified, this function can be used internally by View3D to obtain a colormap that matches the visual returned by function
XintGlChooseVisual. The colormap returned can be assigned to a View3D widget using Core resource XmNcolormap.

When creating multiple View3D widgets, XintGlAllocateColormap can be used to make sure they all share the same colormap. This function requires a visual compatible with OpenGL, which can be obtained by calling function XintGlChooseVisual or by calling OpenGL function glXChooseVisual.

     Colormap XintGlAllocateColormap (...)

Display *displayDisplay ID.
intscreenScreen number.
Visual *visualVisual for the colormap.
Booleanuse_default_colormapIf False, function always allocates a new colormap. If True, function returns the default colormap if the visual passed is equal to the default visual.


XintGlChooseVisual

This function selects a visual that is compatible with OpenGL and that can be assigned to a View3D widget, using resource XmNvisual. This function is called internally by the View3D widget if no visual has been assigned to it. Normally it should only be called in special cases, for example if you want to create more than one View3D widget (see function XintGlAllocateColormap).

     Visual *XintGlChooseVisual(...)

Display *displayDisplay ID.
intscreenScreen number.