SDL_Reverse?
I don't know about SDL, but you can flip an image by scaling it by -1. But I don't know if SDL has a SDL_Scale or whatever...
no, but it is pretty easy to write it yourself.
as for getpixel and putpixel functions, just google them or search them on the SDL mailing list.
[Edited by - clayasaurus on October 3, 2004 5:31:53 PM]
SDL_Surface *xmirror(SDL_Surface *toflip){ SDL_Surface *surface = SDL_CreateRGBSurface(SDL_SWSURFACE, toflip->w, toflip->h, toflip->format->BitsPerPixel, 0, 0, 0, 0); for (int x = 0; x < surface->w; x++) for(int y = 0; y < surface->h; y++) putpixel(surface, surface->w-x-1,y, getpixel(toflip,x,y)); return surface; }SDL_Surface *ymirror(SDL_Surface *toflip){ SDL_Surface *surface = SDL_CreateRGBSurface(SDL_SWSURFACE, toflip->w, toflip->h, toflip->format->BitsPerPixel, 0, 0, 0, 0); for (int x = 0; x < surface->w; x++) for (int y = 0; y < surface->h; y++) putpixel(surface, x,surface->h-y-1,getpixel(toflip,x,y)); return surface; }
as for getpixel and putpixel functions, just google them or search them on the SDL mailing list.
[Edited by - clayasaurus on October 3, 2004 5:31:53 PM]
Check out some of the add-on SDL libs like SDL_gfx. They provide rotozoom functions and much more. Go straight to the SDL website for a list of available libs.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement