home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / sgi / 16617 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  1.8 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!swrinde!cs.utexas.edu!rutgers!cmcl2!adm!news
  2. From: joachim@cat.informatik.uni-erlangen.de (Joachim Guenther)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: ortho2 and ortho
  5. Message-ID: <34144@adm.brl.mil>
  6. Date: 18 Nov 92 19:25:16 GMT
  7. Sender: news@adm.brl.mil
  8. Lines: 37
  9.  
  10.  
  11. Patrick ChengSan Teo <teo@xenon.stanford.edu> wrote:
  12. => I've just finished implementing the Lisp FFI for GL.  Everything seems
  13. => to work fine except for ortho(), ortho2() and window().  I tried
  14. => (ortho2 0.0 60.0 0.0 60.0), i.e. ortho2(0.0, 60.0, 0.0, 60.0) which I
  15. => got from the book and it gave me a ERR_BADWINDOW error.  The arguments
  16. => to ortho2 are floats and those check out correctly.  Does anybody know
  17.  
  18. I encountered the same problem when I tried to call some GL routines
  19. from Lucid CommonLisp. I don't know what exactly gets messed up,
  20. but it must have something to do with LCLs passing of float variables
  21. - you're never sure whether they'll be single or double-floats...
  22.  
  23. Anyway, the C compiler seems to be somewhat smarter than LISP 
  24. and the problem vanished when I wrote a C whopper like
  25.  
  26.   void c_ortho(left, right, bottom, top, near, far)
  27.   Coord left, right, bottom, top, near, far;
  28.   {
  29.      ortho(left, right, bottom, top, near, far);
  30.   }
  31.  
  32. and had LISP call c_ortho instead of ortho. This has to be done for
  33. all (GL-)routines taking :single-float and not (:pointer :foo) arguments.
  34.  
  35. This magic works for Lucid LISP, I don't know about others.
  36. You might want to printf the arguments inside the whopper, to see
  37. what you really get...
  38.  
  39. -- Joachim.
  40.  
  41.  
  42. -----------------------------------------------------------------------
  43. Joachim Guenther         
  44. CAT Software GmbH        EMail: joachim@cat.informatik.uni-erlangen.de
  45. Am Weichselgarten 23     Phone: ++49-9131-777750
  46. D-8520 Erlangen 26       Fax:   ++49-9131-777711
  47.