Re-added SDL_SoftStretch() to the API

This is needed for sdl2-compat, since a blit is not quite equivalent.
This commit is contained in:
Sam Lantinga 2025-02-02 13:40:57 -08:00
parent 842f85da05
commit a98a4b8a68
4 changed files with 26 additions and 0 deletions

View file

@ -1173,6 +1173,29 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const S
*/
extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
/**
* Perform a stretched pixel copy from one surface to another.
*
* \param src the SDL_Surface structure to be copied from.
* \param srcrect the SDL_Rect structure representing the rectangle to be
* copied, may not be NULL.
* \param dst the SDL_Surface structure that is the blit target.
* \param dstrect the SDL_Rect structure representing the target rectangle in
* the destination surface, may not be NULL.
* \param scaleMode the SDL_ScaleMode to be used.
* \returns true on success or false on failure; call SDL_GetError() for more
* information.
*
* \threadsafety The same destination surface should not be used from two
* threads at once. It is safe to use the same source surface
* from multiple threads.
*
* \since This function is available since SDL 3.2.0.
*
* \sa SDL_BlitSurfaceScaled
*/
extern SDL_DECLSPEC bool SDLCALL SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
/**
* Perform a tiled blit to a destination surface, which may be of a different
* format.

View file

@ -1233,6 +1233,7 @@ SDL3_0.0.0 {
SDL_AudioStreamDevicePaused;
SDL_ClickTrayEntry;
SDL_UpdateTrays;
SDL_SoftStretch;
# extra symbols go here (don't modify this line)
local: *;
};

View file

@ -1258,3 +1258,4 @@
#define SDL_AudioStreamDevicePaused SDL_AudioStreamDevicePaused_REAL
#define SDL_ClickTrayEntry SDL_ClickTrayEntry_REAL
#define SDL_UpdateTrays SDL_UpdateTrays_REAL
#define SDL_SoftStretch SDL_SoftStretch_REAL

View file

@ -1266,3 +1266,4 @@ SDL_DYNAPI_PROC(SDL_ThreadState,SDL_GetThreadState,(SDL_Thread *a),(a),return)
SDL_DYNAPI_PROC(bool,SDL_AudioStreamDevicePaused,(SDL_AudioStream *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_ClickTrayEntry,(SDL_TrayEntry *a),(a),)
SDL_DYNAPI_PROC(void,SDL_UpdateTrays,(void),(),)
SDL_DYNAPI_PROC(bool,SDL_SoftStretch,(SDL_Surface *a,const SDL_Rect *b,SDL_Surface *c,const SDL_Rect *d,SDL_ScaleMode e),(a,b,c,d,e),return)