Xlib Colormap question (X, not DOS)

Xlib Colormap question (X, not DOS)

Post by Dave Wooda » Tue, 14 Sep 1993 23:26:40

  I've done lots of graphics programming, but am pretty new to Xlib.  Right
now, I'm trying to figure out how the colormap works.  I'm running on a SUN
X-term, so I have 8 color planes (256 max. colors :-( ).

  According to my books, to find out how many *available* (read/write) colors
there are, you have to use XAllocColorCells in a binary search until you find
the largest number that returns a valid response.  This seems to work okay
except for the following problems:

  1) If I don't run anything that needs new colors, my code says 128 are free.
     If I run "xv -quit" to put something in the background, XAllocColorCells
     fails to find ANY free colors.  I've looked through the xv source, and
     it uses XAllocColorCells to allocate its colors so they SHOULD be read/
     write.  But even after the process is dead and gone, I can't get to them
     - but xv can!

  2) I understand that the window manager uses a few colors for itself.  But
     on my machine, the first 70 or so seem to be unchangeable, even by xv!

  Any clues?  Thanks,  Dave


Xlib Colormap question (X, not DOS)

Post by Rosalee Nerheim-Wol » Fri, 24 Sep 1993 14:01:44

Best thing to do is to get a colormap, write in all the colors you want,
and then hand it to the window manager (you can do this at window
creation time, if you've already got your colormap set up).  Then,
the window manager will use the (software) colormap for whatever
window the input focus is in.

Generally, it's considered * to manipulate the hardware colormap

R Wolfe
Department of Computer Science
DePaul University


1. Xlib under MS-DOS(?)

This is probably a dumb question, but here goes:

I have a number of X11 based applications that I would like to run on
a '386 under MS-DOS.  I don't want concurrent execution, just one
application at a time.  So, I thought that an Xlib implementation with
a "server" which was linked into the application and which contained
enough window manager to "manage" a single client would do the job.

Does such a beast exist?  Would anyone else be interested in one if I
wrote it?

Please respond directly, and if there is enough interest, I will

Martin Fouts

 UUCP:  ...!pyramid!garth!fouts (or) uunet!ingr!apd!fouts

PHONE:  (415) 852-2310            FAX:  (415) 856-9224
 MAIL:  2400 Geng Road, Palo Alto, CA, 94303

Moving to Montana;  Goin' to be a Dental Floss Tycoon.
  -  Frank Zappa

2. Corel to Freehand question.

3. Mixing GL and Xlib (not Xt)

4. receive dirty shopkeepers, do you waste them

5. 24bit Color Xlib Question

6. : 3DSMAX mailing list?

7. GL and X colormap question

8. Question about colormap

9. GL and X colormap question

10. Multiple colormap question

11. GLXgetconfig popup visual/colormap question

12. X Colormap definition Question