[SDL] Re: quick flip an image

Smartuser smartuser at hotmail.com
Wed Jan 5 13:21:43 PST 2005


Thanks for all your help (other people included)
I think i can do it now!
Sometime you need other ways of thinking.

Sebastian Beschke wrote:
> Hi,
> 
> There's been a lot of discussion about the pros and cons of image 
> flipping and whatnot in this thread, and to be honest I haven't read all 
> of it, but the truth is that mirroring images is useful in a lot of 
> simple games. Since I've just written some code to do this, I might as 
> well post it here.
> 
> One catch: It's in D, but the differences to C shouldn't be so great. 
> Basically, replace the . with ->, replace uint with Uint32 and ubyte 
> with Uint8. And one line contains the copy of an array slice, which 
> would need to be reimplemented with memcpy in C.
> 
> The actual point is to show the principle; if you know the principle of 
> it, reimplementing it should be easy.
> 
> By the way, it doesn't matter if it's slow, because it should be done at 
> load time anyway (or at the time it's first requested, but *not* at 
> every draw).
> 
> 

His code..





More information about the SDL mailing list