[Pal-devel] API suggestion [was Re: Installation problem]

matthieu.villeneuve at free.fr matthieu.villeneuve at free.fr
Thu Jul 12 06:19:31 UTC 2007


Hello,

Selon Tomi Neste <flatlander at yellow-hut.com>:
> <matthieu.villeneuve at free.fr> kirjoitti Mon, 09 Jul 2007 15:40:29 +0300:
> > I'm trying to install PAL (SBCL / Linux Ubuntu) and running into an
> > "Attempt to call an undefined alien function" error message at startup,
> > or when calling:
> >   (pal-ffi:init (logior pal-ffi:+init-video+ pal-ffi:+init-audio+))
> >
> > [...]
>
> Thanks for reporting this, there was quite a stupid mistake in the
> ffi.lisp that prevented PAL from loading the foreign dynamic libraries.
> Should be fixed in the CVS by now, alternatively you could change the
> library definitions in the beginning of pal/ffi.lisp to be as follows:
>
> [...]

Thanks, it works perfectly.
I'm now in the process of writing a little "Mario Kart"-like game, and
I'd like to suggest what I think could be a little API improvement
regarding the DRAW-IMAGE function.
As of now, the function takes 2 mandatory arguments and 2 optional ones:

  (draw-image image position
              &optional angle scale)

As I understand it, specifying a non-null angle causes the image
to be centered around POSITION instead of being aligned on its top-left
corner, and it would seem more consistent to me if alignment was
specified by other parameters. Moreover, I tend to prefer keyword
parameters, as they allow more flexible and readable calls.
What would you think of the following interface?

  (draw-image image position
              &key (angle 0.0) (scale 1.0)
                   (halign :left) (valign :top))

I'm afraid I know close to nothing about OpenGL so I can't offer a patch,
but if you see another way for me to contribute to PAL, please juste let
me know.

Thanks a lot,


--
Matthieu Villeneuve



More information about the pal-devel mailing list