[SDL] IMG_Load and SDL_Surface flags

Alberto Luaces aluaces at udc.es
Fri Dec 21 00:39:54 PST 2007


El Friday 21 December 2007 01:45:36 Torsten Giebl escribió:
> > You should note that SDL_SWSURFACE isn't really a flag at all, it is
> > defined as 0.
> >
> > To test whether a surface is in hardware is
> >
> >> if( my_surface->flags & SDL_HWSURFACE )
>
> Better is to test :
>
> if( (my_surface->flags & SDL_HWSURFACE) == SDL_HWSURFACE )

Why? Those SDL_ flags always have only one bit set. Isn't it the usual way of 
implementing it? Otherwise it could exist clashes between flags.


More information about the SDL mailing list