Surface rotation and scaling


SDL_Rect sge_transform(SDL_Surface *src, SDL_Surface *dst, float angle, float xscale, float yscale, Uint16 px, Uint16 py, Uint16 qx, Uint16 qy, Uint8 flags)
Draws a rotated and scaled version of src on dest. Flags: (may be ORed, eg. SGE_TAA|SGE_TSAFE) To get optimal performance PLEASE make sure that the two surfaces has the same pixel format (color depth) and doesn't use 24-bpp.

Note: Does lock the surfaces.

Returns SDL_Rect: The size and position (bounding box) of the rendered image on dst surface.




SDL_Surface *sge_transform_surface(SDL_Surface *src, Uint32 bcol, float angle, float xscale, float yscale, Uint8 flags)
Returns a rotated and scaled version of src. See sge_transform() for more information. The new surface will have the same depth and pixel format as the src surface.

Returns SDL_Surface*: A pointer to the new surface or NULL on failure. Don't forget to free this surface later with SDL_FreeSurface().






Copyright © 1999-2003 Anders Lindström
Last updated 030808