Image::copySurface added

This commit is contained in:
Øystein Ingmar Skartsæterhagen 2007-03-01 13:00:51 +00:00
parent db9e1b29d9
commit 6b380ae5e7
2 changed files with 13 additions and 1 deletions

View File

@ -16,4 +16,16 @@ namespace Image
}
}
SDL_Surface *copySurface(SDL_Surface *s)
{
SDL_Surface *copy = SDL_CreateRGBSurface(SDL_SWSURFACE, s->w, s->h,
s->format->BitsPerPixel,
s->format->Rmask, s->format->Gmask,
s->format->Bmask, s->format->Amask);
SDL_BlitSurface(s, NULL, copy, NULL);
return copy;
}
}

View File

@ -22,7 +22,7 @@ namespace Image
{
void threshold(SDL_Surface *image, int lowerBound, int upperBound);
SDL_Surface *copySurface(SDL_Surface *s);
}
#endif /* ifndef _IMAGE_H_ */