Re: [AD] Function parameter ordering conventions

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thu, 2007-06-21 at 10:23 -0600, Trent Gamblin wrote:
> Stephen Apostolopoulos wrote:
> > Eh, this is just asking for trouble! You want an interface to be  
> > consistent: a new user using al_draw_bitmap should be right to assume that  
> > similar functions would work roughly the same (al_put_pixel is similar  
> > enough, three parameter, one is a pointer). If the above syntax was used,  
> > he would have to make a round-trip to the manual for every single  
> > function, because he'd never be sure what the parameter order would be  
> > like - not good!
> 
> Well it's not entirely inconsistent. The user would only have to 
> remember that when drawing bitmaps, the bitmap parameter goes first, and 
> when drawing primitives, the color goes last.
> 

That just made me think of something - assume a hypothetical function to
draw a tinted bitmap, it could then consequently be:

al_draw_tinted_bitmap(AL_BITMAP *bitmap, int x, int y, AL_COLOR *color)

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/