Allocate and attach a palette sharing structure to a colormap
Source position: agraphics.pas line 2435
function AttachPalExtra( |
Cm: PColorMap; |
Vp: PViewPort |
):LongInt; |
Cm |
|
A pointer to a color map created by GetColorMap(). |
Vp |
|
A pointer to the viewport structure associated with the ColorMap. |
0 if sucessful, else an error number. The only currently defined error number is out of memory (1).
Allocates and attaches a PalExtra structure to a ColorMap. This is necessary for color palette sharing to work. The PalExtra structure will be freed by FreeColorMap(). The set of available colors will be determined by the mode and depth of the viewport.
Note:
This function is for use with custom ViewPorts and custom ColorMaps, as Intuition attaches a PalExtra to all of its Screens. If there is already a PalExtra associated with the ColorMap, then this function will do nothing.
|
Allocate and initialize Colormap |
|
|
Free the ColorMap structure and return memory to free memory pool. |
|
|
Obtain a free palette entry for use by your program. |
|
|
Search for the closest color match, or allocate a new one. |