home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / hp / 14488 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  2.0 KB

  1. From: lang@hpfcso.FC.HP.COM (John J. Lang)
  2. Date: Mon, 4 Jan 1993 17:30:12 GMT
  3. Subject: Re: Using starbase in X
  4. Message-ID: <7371511@hpfcso.FC.HP.COM>
  5. Organization: Hewlett-Packard, Fort Collins, CO, USA
  6. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!hpscit.sc.hp.com!hplextra!hpfcso!lang
  7. Newsgroups: comp.sys.hp
  8. References: <1993Jan3.225641.22767@news.media.mit.edu>
  9. Lines: 38
  10.  
  11. In comp.sys.hp, floyd@media.mit.edu (Bob Sabiston) writes:
  12. > Does anyone know if the R_LOCK_DEVICE gescape can be used in programs
  13. > that run in Xwindows?  If so, anybody have any idea what could cause the
  14. > program to hang my machine?
  15.  
  16. It is possible to use R_LOCK_DEVICE in an X window, but not easy.  What
  17. is probably happening is that a Starbase call sent a request to the
  18. X server.  If the device is locked, the X server cannot continue, and a
  19. deadlock happens (ie. Starbase is waiting on the X server, the X server
  20. is waiting for the device lock, which Starbase has).  This could also
  21. happen if you program is making Xlib calls
  22.  
  23. If you have to use R_LOCK_DEVICE, make sure you unlock the device before
  24. you make any Starbase calls.  For example, your code should be organized
  25. like this:
  26.  
  27.     starbase_call()
  28.     starbase_call()
  29.     gescape(R_LOCK_DEVICE)
  30.     for each pixel {
  31.     access frame buffer
  32.     }
  33.     gescape(R_UNLOCK_DEVICE)
  34.     starbase_call()
  35.  
  36. Another problem with accessing the frame buffer directly, is that you
  37. must know the location of the window you are accessing.  There is no
  38. protection to keep you from drawing outside the window.  There is also
  39. no way to find out what parts of your window are obscured by other
  40. windows.  This means you program must always keep it's window as the
  41. topmost, and you must inquire the location and size of your window.
  42. This is of course easier if you are just doing something for your
  43. personal use (since you can control the environment) rather than a
  44. general utility or application.  In any case, the above should indicate
  45. how to get around the hang.
  46.  
  47. John Lang
  48. lang@fc.hp.com
  49.