Opinion?

Should this function free the surface passed in, if successful?
/*

  • Converts a surface from one pixel format to another, and maps the surface
  • to the specified format so that SDL_BlitSurface() can accelerate the blit
  • or perform straight memory copies.*
  • If this function fails, it returns NULL and the given surface must be
  • freed. Otherwise the new surface can be used in place of the old one.
    */
    SDL_DEFUN(SDL_Surface *, SDL_ConvertSurface,
    (SDL_Surface *src, SDL_PixelFormat *fmt))

Should this function use colorkeying instead of a mask?
/*

  • Sets the icon for the display window.
  • This function must be called before the first call to SDL_SetVideoMode().
  • It takes an icon surface, and a mask in MSB format.
    */
    SDL_DEFUN(void, SDL_WM_SetIcon, (SDL_Surface *icon, Uint8 *mask))

What do you think?

-Sam Lantinga				(slouken at devolution.com)


Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/projects/SDL/

Should this function free the surface passed in, if successful?
Shouldn’t it be the programmer’s responsibility to free the
surface passed in when done with it? Maybe there is a reason that
the programmer needs to keep the surface around (to do other
modifications). Maybe I’m not thinking it through properly, but
I’d say “No”.

SDL_DEFUN(SDL_Surface *, SDL_ConvertSurface,
(SDL_Surface *src, SDL_PixelFormat *fmt))

Should this function use colorkeying instead of a mask?
Not sure about that one.
What do you think?
I think I really need practical experience of doing
something with your lib, as soon as I finish my N other programming
assignments and projects and diversions.

I’ll try to get the jist of the SDL over the course of this
week.

Best Regards,
David Sowsy> -Sam Lantinga (slouken at devolution.com)


Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/projects/SDL/