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