Added SDL_FlipSurface() to flip a surface vertically or horizontally

Fixes https://github.com/libsdl-org/SDL/issues/8857
This commit is contained in:
Sam Lantinga 2024-01-20 06:31:37 -08:00
parent 2cd583ee13
commit 308906ba25
13 changed files with 184 additions and 21 deletions

View file

@ -75,6 +75,15 @@ typedef enum
SDL_SCALEMODE_BEST /**< anisotropic filtering */
} SDL_ScaleMode;
/**
* The flip mode
*/
typedef enum
{
SDL_FLIP_NONE, /**< Do not flip */
SDL_FLIP_HORIZONTAL, /**< flip horizontally */
SDL_FLIP_VERTICAL /**< flip vertically */
} SDL_FlipMode;
/**
* A collection of pixels used in software blitting.
@ -602,6 +611,18 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface,
extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface,
SDL_Rect *rect);
/*
* Flip a surface vertically or horizontally.
*
* \param surface the surface to flip
* \param flip the direction to flip
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*/
extern DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
/*
* Creates a new surface identical to the existing surface.
*