Hi,

Am Donnerstag, 19. Februar 2004 05:54 schrieb chromatic:
> On Fri, 2004-02-13 at 09:57, Jens Rieks wrote:
> > here is an easy to use (with PIR code) wrapper of the SDL library.
> > It tries to hide all internals of the wrapper and makes the most
> > important SDL functions directly available in PIR code.
>
> Overall this looks good.  I am not sure if it is better to define flags
> as constants or to do something like this:
I tried to make a 1:1 mapping of the SDL C functions to PIR subs, the 
arguments are by intention the same as in there C counterparts.

>       .sym pmc flags
>
>       new flags, .PerlHash
>       set flags['double_buffered'], 1
>       set flags['full_screen'], 1
>
>       .sym pmc screen
>       screen = _SDL_SetVideoMode( 320, 200, 0, flags )
>
> Then only _SDL_SetVideoMode has to care about the flags.
>
> It is an idea anyway.  Another idea is to pass similar arguments into
> _SDL_init_flags() and receive back an integer.  I prefer to hide that in
> _SDL_SetVideoMode() though.
A high(er) level API should IMHO use other names, just SetVideoMode for 
example. It would be confusing is someone knows the C functions and then has 
to figure out the the function names are equal, but that the parameters are 
different.

> -- c
jens

Reply via email to