home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / sgi / bugs / 15 < prev    next >
Encoding:
Internet Message Format  |  1992-12-20  |  4.2 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!lll-winken!anduin!wiltzius
  2. From: wiltzius@anduin.ocf.llnl.gov (Dave Wiltzius)
  3. Newsgroups: comp.sys.sgi.bugs
  4. Subject: (Long) Reality Engine and colormap incompatibilities
  5. Message-ID: <143761@lll-winken.LLNL.GOV>
  6. Date: 18 Dec 92 06:20:41 GMT
  7. Sender: usenet@lll-winken.LLNL.GOV
  8. Organization: Lawrence Livermore Nat'l Lab.
  9. Lines: 90
  10. Nntp-Posting-Host: anduin.ocf.llnl.gov
  11.  
  12.  
  13. The following is relevant only for IRIX 4.0 or later systems.
  14.  
  15. Within the past few weeks I posted a "bug" with the
  16. Reality Engine regarding colormaps.  Since then, I have
  17. sorted things out (I think!) with the help of several SGI
  18. folks, including the SGI hotline.  The information I did
  19. get was in pieces and so I thought I would share a brief
  20. explanation of the problem and near solutions.  A thorough
  21. explanation would be worthy of an online document that
  22. interested parties could FTP since I suspect this is an
  23. "advanced" topic of limited interest.  Please note:  I
  24. reference the Reality Engine (RE) as the distinguishing factor
  25. when the *real* factor is multiple hardware color maps.
  26. Here goes (I know this is going to be longer than I had hoped).
  27.  
  28. Problem: A mixed-mode (Motif GUI with mixed-mode (GL) windows)
  29. application running on a PI flashes when the input focus
  30. goes between GL windows and non-GL windows.  This is
  31. because the PI (and most SGI platforms) have only one
  32. hardware colormap that is shared for GL and X (Motif, etc)
  33. windows.
  34.  
  35. Solution for PI: Set GL colors using XStoreColors on the
  36. default colormap (a different colormap could be used,
  37. but the problems are the same).  That is, instead of
  38. setting GL colors with "mapcolor", have the application
  39. use XStoreColors.  This could be done be redefining the
  40. "mapcolor" function to allocate (XAllocColorCells) and
  41. set (XStoreColors).  Note that the allocation must allocate
  42. all the colors that GL will eventually want to set.  Also,
  43. you don't want to step on the colors used by Motif, etc.
  44.  
  45. Now run this application on the RE (multiple hardware
  46. color maps).  The colors set (by XStoreColors, as
  47. noted above) for GL do not take affect.  This is because
  48. all GL windows have their own hardware colormap whose
  49. colors can only be set via the "mapcolor" function in
  50. the GL library.  The default X colormap is actually
  51. another hardware colormap.  The former can be
  52. viewed using the "showmap" tool.  The latter can be
  53. viewed using the "xshowcmap" tool.  (I was incorrectly
  54. informed by SGI that simply each application gets a different
  55. colormap.)  Please note that the RE (multiple hardware
  56. colormaps) neatly solves the problem that mixed-mode
  57. applications have on other platforms:  GL code from
  58. a pure GL application (i.e. no X, Motif, etc) can be
  59. placed, without change, in a mixed-mode window.
  60.  
  61. So the RE *requires* that the GL window use "mapcolor".
  62. Other SGI machines require that GL colors be set
  63. via XStoreColor on the default colormap if flashing
  64. is to be avoided.  Hence it is possible to write
  65. portable code (i.e. dynamically adaptable to the
  66. platform it is running on) only if you have access to
  67. the sources so all "mapcolor" calls are left alone for
  68. the RE or converted to appropriate XAllocColorCells/XStoreColor
  69. calls.  Which is often not the case if you are using
  70. commercial libraries (i.e. no source) based on GL.
  71.  
  72. If the application is "pure" GL (uses winopen, etc instead
  73. of Motif), then only the GL colormap is used and of
  74. course the colors are set only using "mapcolor".
  75.  
  76. In summary, on the RE all GL windows use the GL
  77. hardware colormap (viewed by showmap tool).  All
  78. X (Motif, etc) windows use the default X hardware
  79. colormap (viewed by xshowcmap tool).
  80.  
  81. There may be a nifty solution to the problem of writing
  82. portable, mixed-mode applications.  If a solution
  83. exists that would let me use GL libraries for which I
  84. do not have the source, I would be very interested in
  85. it.
  86.  
  87. Frankly, I haven't mucked around much in graphics for
  88. about 8 years now.  Things have changed.  Different
  89. color maps for different windows?  Must be some fast
  90. hardware.
  91.  
  92. SGI may have bigger problems to address, but a short
  93. essay on colormaps in the context of Motif, GL, various
  94. SGI hardware platforms and life would be interesting
  95. to some of us.  Or pointers to more info.
  96.  
  97. Hope this helps.
  98.   Dave Wiltzius
  99.   LLNL
  100.   wiltzius@llnl.gov
  101.  
  102.