Skip to content

Commit

Permalink
Sync SDL3 header -> wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
SDLWikiBot committed Feb 3, 2025
1 parent e414dd6 commit 989f347
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SDL3/QuickReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ bool SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst
bool SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform low-level surface blitting only.
bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); // Perform a scaled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); // Perform low-level surface scaled blitting only.
bool SDL_SoftStretch(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.
bool SDL_StretchSurface(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.
bool SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a tiled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a scaled and tiled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format.
Expand Down
2 changes: 1 addition & 1 deletion SDL3/QuickReferenceNoUnicode.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ bool SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst
bool SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform low-level surface blitting only.
bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); // Perform a scaled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); // Perform low-level surface scaled blitting only.
bool SDL_SoftStretch(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.
bool SDL_StretchSurface(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.
bool SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a tiled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a scaled and tiled blit to a destination surface, which may be of a different format.
bool SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int left_width, int right_width, int top_height, int bottom_height, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect); // Perform a scaled blit using the 9-grid algorithm to a destination surface, which may be of a different format.
Expand Down
6 changes: 2 additions & 4 deletions SDL3/README/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1845,8 +1845,6 @@ SDL_BlitSurface() and SDL_BlitSurfaceScaled() now have a const `dstrect` paramet

SDL_BlitSurfaceScaled() and SDL_BlitSurfaceUncheckedScaled() now take a scale parameter.

SDL_SoftStretch() now takes a scale parameter.

SDL_PixelFormat is used instead of Uint32 for API functions that refer to pixel format by enumerated value.

SDL_SetSurfaceColorKey() takes an bool to enable and disable colorkey. RLE acceleration isn't controlled by the parameter, you should use SDL_SetSurfaceRLE() to change that separately.
Expand Down Expand Up @@ -1880,8 +1878,8 @@ The following functions have been removed:
* SDL_GetYUVConversionMode()
* SDL_GetYUVConversionModeForResolution()
* SDL_SetYUVConversionMode() - use SDL_SetSurfaceColorspace() to set the surface colorspace and SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER with SDL_CreateTextureWithProperties() to set the texture colorspace. The default colorspace for YUV pixel formats is SDL_COLORSPACE_JPEG.
* SDL_SoftStretch() - use SDL_BlitSurfaceScaled() with SDL_SCALEMODE_NEAREST
* SDL_SoftStretchLinear() - use SDL_BlitSurfaceScaled() with SDL_SCALEMODE_LINEAR
* SDL_SoftStretch() - use SDL_StretchSurface() with SDL_SCALEMODE_NEAREST
* SDL_SoftStretchLinear() - use SDL_StretchSurface() with SDL_SCALEMODE_LINEAR

The following symbols have been renamed:
* SDL_PREALLOC => SDL_SURFACE_PREALLOCATED
Expand Down
45 changes: 45 additions & 0 deletions SDL3/SDL_StretchSurface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# SDL_StretchSurface

Perform a stretched pixel copy from one surface to another.

## Header File

Defined in [<SDL3/SDL_surface.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_surface.h)

## Syntax

```c
bool SDL_StretchSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
```
## Function Parameters
| | | |
| ------------------------------ | ------------- | ----------------------------------------------------------------------------------------------------------------- |
| [SDL_Surface](SDL_Surface) * | **src** | the [SDL_Surface](SDL_Surface) structure to be copied from. |
| const [SDL_Rect](SDL_Rect) * | **srcrect** | the [SDL_Rect](SDL_Rect) structure representing the rectangle to be copied, may not be NULL. |
| [SDL_Surface](SDL_Surface) * | **dst** | the [SDL_Surface](SDL_Surface) structure that is the blit target. |
| const [SDL_Rect](SDL_Rect) * | **dstrect** | the [SDL_Rect](SDL_Rect) structure representing the target rectangle in the destination surface, may not be NULL. |
| [SDL_ScaleMode](SDL_ScaleMode) | **scaleMode** | the [SDL_ScaleMode](SDL_ScaleMode) to be used. |
## Return Value
(bool) Returns true on success or false on failure; call
[SDL_GetError](SDL_GetError)() for more information.
## Thread Safety
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.
## Version
This function is available since SDL 3.2.0.
## See Also
- [SDL_BlitSurfaceScaled](SDL_BlitSurfaceScaled)
----
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategorySurface](CategorySurface)

0 comments on commit 989f347

Please sign in to comment.