[SDL] SDL_Flip vs SDL_UpdateRect: what's better/smoother?
Brian
brian.ripoff at gmail.com
Tue Jun 12 07:06:41 PDT 2007
Hmm...
Looks to me that SDL_HWSURFACE is 0x00000001, so anything & 0x000001
will either be 1 (have hardware) or 0 (don't). I cannot understand how
you are getting different values in these 2 tests.
It may be a operator precedence issue. *checks* yup, it seems to be.
== is higher priority than bitwise &, so your code looks like this:
( screen->flags & SDL_HWSURFACE == SDL_HWSURFACE )
which is
( screen->flags & (!0) )
whereas
( SDL_GetVideoSurface()->flags & SDL_HWSURFACE == 0 )
is
(( SDL_GetVideoSurface()->flags & 0 )
Instead, use
if( (screen->flags & SDL_HWSURFACE) == SDL_HWSURFACE)
or
if( (SDL_GetVideoSurface()->flags & SDL_HWSURFACE) != 0)
On 12/06/07, voidstar <voidstar at tin.it> wrote:
> > It may not be easy/possible to get a hardware surface on your platform
> > at all. Linux tends to be very picky about who can write directly to
> > hardware.
> > I recommned you give these a read:
> > http://www.oreillynet.com/articles/author/1205
>
> Ok thanks I'll read it, but I'm not under Linux, I'm using Windows XP!
>
> I just tried this test:
>
> ( screen->flags & SDL_HWSURFACE == SDL_HWSURFACE )
>
> and it tells me "true" => hardware surface
>
> While your test:
>
> ( SDL_GetVideoSurface()->flags & SDL_HWSURFACE == 0 )
>
> tells me "true" => NO hardware surface
>
> Why?
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
More information about the SDL
mailing list