XSolarisCheckColormapEquivalenceXLIBuFUNXSolarisCheckColormapEquivalence(3Xmu)NAMEXSolarisCheckColormapEquivalence - determines if two visuals are col‐
ormap equivalent
SYNOPSIS
cc [ flag ... ] file ... -lXmu [ library ... ]
#include <X11/Xmu/XmuSolaris.h>
Bool XSolarisCheckColormapEquivalence(
Display *display,
int screen,
Visual *visual1,
Visual *visual2);
ARGUMENTS
display Specifies the connection to the X server.
screen An integer specifying the screen on which the visuals are to
be searched.
visual1 Specifies the first visual type supported on the screen. If
the visual type is not one supported by the screen, a Bad‐
Match error results.
visual2 Specifies the second visual type supported on the screen. If
the visual type is not one supported by the screen, a Bad‐
Match error results.
DESCRIPTION
This function returns True if the two Visuals are Colormap Equivalent,
otherwise it returns False.
Colormap Equivalence is a minor relaxation of the X protocol supported
by the Solaris X server Xsun(1). Two Visuals are Colormap Equivalent
if it is possible to use a Colormap created with one of the Visuals as
the Colormap of a Window in the other Visual. This is useful on a sys‐
tem that supports Visuals that differ only in their OpenGL (GLX)
Attributes.
For example, to avoid colormap flashing, when creating a window with a
Visual that is in the same depth as the RootWindow, use the Default
Colormap. In standard X, this is only possible if the Visual is the
DefaultVisual. With Colormap Equivalence the requirement is relaxed.
To use this function, an application should link with libXmu.
EXAMPLES
You may be able to avoid creating a new colormap by using the following
code:
if (!XSolarisCheckColormapEquivalence(dpy, screen,
vi->visual, DefaultVisual(dpy, screen)) {
attributes.colormap = XCreateColormap(dpy, root,
vi->visual, AllocNone);
valuemask = CWColormap;
}
window = XCreateWindow(dpy, root, 0, 0, 500, 500, 0,
vi->depth, CopyFromParent, vi->visual,
valuemask, &attributes);
SEE ALSOXCreateWindow(3X11), glXGetConfig(3gl).
X Version 11 11 JanXSolarisCheckColormapEquivalence(3Xmu)