[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | DECWINDOWS 26-JAN-89 to 29-NOV-90 |
Notice: | See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit |
Moderator: | STAR::VATNE |
|
Created: | Mon Oct 30 1989 |
Last Modified: | Mon Dec 31 1990 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3726 |
Total number of notes: | 19516 |
981.0. "XAllocColorCells of ALL CELLS?" by KASINO::TALLETT (Window mangler...) Tue Jun 20 1989 06:32
Hi folks!
Why can't I allocate all the planes of a workstation in
one XAllocColorCells call if I am using a private colormap?
More specifically, the following code barfs on a 4-plane
server (it is supposed to allocate 16 colours):
colormap = DefaultColormap(dpy, screen);
if(XAllocColorCells(dpy, colormap, False, planes, 4, &pixel, 1)==0){
if((colormap = XCreateColormap(dpy, root, visual, AllocNone))==0){
printf("Failed to create private colormap\n");
exit(1);
}
if(XAllocColorCells(dpy, colormap, False, planes, 4, &pixel, 1)==0){
printf("Couldnt alloc color cells\n");
exit(1);
}
}
I also tried changing the "4"s above to "8"s and running on an
eight plane workstation (GPX) with the same problem. I can
grab 3 or 7 planes respectively, but not all the planes. Note
AllocAll works in the XCreateColormap, but then I have to hard
code the plane masks - yuk!
Did I do something wrong? Does XAllocColorCells not want to give
me the cursor entries? (If so, why does XCreateColormap(AllocAll))
Is this supposed to work?
Thanks in advance!
Regards,
Paul Tallett
CEC Karlsruhe
West Germany
T.R | Title | User | Personal Name | Date | Lines |
---|
981.1 | Bug in common server? (Works on MIT servers) | KASINO::TALLETT | Window mangler... | Tue Jun 20 1989 12:22 | 10 |
| What is more, the 8-plane version of .0 WORKS on an 8-plane
colour-PMAX! I can allocate all 8 planes of the PMAX in one
XAllocColorCells call.
The plot thickens. I just checked the size of the colormap.
On a VMS GPX it is 256, but on an Ultrix GPX it is 254 !!
C'est une burg n'est ce pas?
Paul
|
981.2 | A few answers | DECWIN::FISHER | Burns Fisher 381-1466, ZKO3-4/W23 | Wed Jun 21 1989 11:36 | 20 |
| Q'est que ce une burg?
In any case, I can answer the last question easily enough. Remember that
a GPX uses the last two colormap entries for the cursor color. Ultrix and
VMS chose to deal with that problem differently. We pre-allocate 254 and
255 in the default colormap so you don't normally overwrite them. However
if you create a cmap of your own, you are free to use all 256 colors. However,
you will trash the cursor with 254 and 255. Ultrix chose to just say that
there are only 254 entries so the last two never get written. If you think
the VMS decision is wrong, mea culpa. I had just gotten told so often that
image people need all 256 that I chose to do it that way.
As to the allocation, I would not be too surprised if the pixel value is
being allocated first, and maybe from the top. Then there are not enough
planes to give you. QAR it if you think it is a bug.
Of coures doing AllocAll would accomplish the same thing.
Burns
|
981.3 | Up to 7 planes. | NYMPH::ZACHWIEJA | It's 85% or bust | Thu Jun 22 1989 12:24 | 13 |
|
I have the same problem on an 8-plane VS2000 running VMS 5.1.
I try and allocate 256 colors from the default colormap asking for
8 planes and 1 pixel, I don't expect it too work because, the
default colormap probably already has some cells allocated.
I then fall back to creating my own colormap, and making the same
request, x$alloc_color_cells, 8 planes, 1 pixel. It also fails.
I can get up to 7 planes.
I'll submit a QAR. _sjz.
|