Added SDL_RotateSurface()

Fixes https://github.com/libsdl-org/SDL/issues/14269
This commit is contained in:
Sam Lantinga
2025-10-22 17:28:34 -07:00
parent a402af506c
commit e18d63a4e2
15 changed files with 286 additions and 33 deletions

View File

@@ -939,6 +939,24 @@ extern SDL_DECLSPEC bool SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface, SD
*/
extern SDL_DECLSPEC bool SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
/**
* Return a copy of a surface rotated clockwise a number of degrees.
*
* The angle of rotation can be negative for counter-clockwise rotation.
*
* When the rotation isn't a multiple of 90 degrees, the resulting surface is larger than the original, with the background filled in with the colorkey, if available, or RGBA 255/255/255/0 if not.
*
* \param surface the surface to rotate.
* \param angle the rotation angle, in degrees.
* \returns a rotated copy of the surface or NULL on failure; call SDL_GetError() for
* more information.
*
* \threadsafety This function is not thread safe.
*
* \since This function is available since SDL 3.2.0.
*/
extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RotateSurface(SDL_Surface *surface, float angle);
/**
* Creates a new surface identical to the existing surface.
*