Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!psuvax1!julius.cs.uiuc.edu!usc!cs.utexas.edu!bcm!etaylor From: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Newsgroups: comp.windows.x Subject: Re: problem with colormap Message-ID: <2702@gazette.bcm.tmc.edu> Date: 9 Nov 90 17:46:40 GMT References: <273A3E4E.7858@ics.uci.edu> Sender: usenet@bcm.tmc.edu Reply-To: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Distribution: usa Organization: Baylor College of Medicine, Houston, Tx Lines: 37 Nntp-Posting-Host: wilkins.iaims.bcm.tmc.edu In article <273A3E4E.7858@ics.uci.edu>, tolani@buckaroo.ics.uci.edu (Deepak Tolani) writes: |> |> |> Being completely unfamiliar with Xlib. I'd appreciate any assistance from you |> X hackers out there. I was trying to get a ray tracing program that someone else |> wrote to work on my DECStation 5000/200. The program fails when it attempts to |> display an image and I traced the problem down to a section of code |> that creates a new colormap. Below is the code fragment that I think is |> causing problems. |> |> |> i = XMatchVisualInfo(display, theScreen, depth, PseudoColor, &visualinfo); |> if (!i) |> i = XMatchVisualInfo(display, theScreen, depth, TrueColor, &visualinfo); |> |> if (!i) |> exit(1); |> |> visual = visualinfo.visual; |> |> rootw = RootWindow(display, theScreen); |> theGC = DefaultGC(display, theScreen); |> cmap = XCreateColormap(display, rootw, visual, AllocAll); |> ... |> |> XStoreColors(display, cmap, carray, CMAPSIZE); |> |> |> This section of code can not run with a TrueColor Visual. The documentation says that XCreateColormap can not be given AllocNone with a TrueColor Visual. Also, XStoreColors is horribly wrong with a TrueColor visual (TrueColor is READ ONLY!). This code must be re-thoughtout to deal with a TrueColor visual. -- Eric Taylor Baylor College of Medicine etaylor@wilkins.bmc.tmc.edu (713) 798-3776