mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-27 05:28:29 +00:00
Added SDL_BlitSurface9Grid() and SDL_RenderTexture9Grid()
This commit is contained in:
@@ -1898,6 +1898,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer,
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect);
|
||||
|
||||
/**
|
||||
* Perform a scaled copy using the 9-grid algorithm to the current rendering target at subpixel precision.
|
||||
*
|
||||
* The pixels in the texture are split into a 3x3 grid, using the corner size for each corner, and the sides and center making up the remaining pixels. The corners are then scaled using `scale` and fit into the corners of the destination rectangle. The sides and center are then stretched into place to cover the remaining destination rectangle.
|
||||
*
|
||||
* \param renderer the renderer which should copy parts of a texture.
|
||||
* \param texture the source texture.
|
||||
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
||||
* used for the 9-grid, or NULL to use the entire texture.
|
||||
* \param corner_size the size, in pixels, of the corner in `srcrect`.
|
||||
* \param scale the scale used to transform the corner of `srcrect` into the corner of `dstrect`, or 0.0f for an unscaled copy.
|
||||
* \param dstrect a pointer to the destination rectangle, or NULL for the
|
||||
* entire rendering target.
|
||||
* \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.
|
||||
*
|
||||
* \sa SDL_RenderTexture
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float corner_size, float scale, const SDL_FRect *dstrect);
|
||||
|
||||
/**
|
||||
* Render a list of triangles, optionally using a texture and indices into the
|
||||
* vertex array Color and alpha modulation is done per vertex
|
||||
|
@@ -1099,6 +1099,34 @@ extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceTiled(SDL_Surface *src, const SDL
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceTiledWithScale(SDL_Surface *src, const SDL_Rect *srcrect, 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.
|
||||
*
|
||||
* The pixels in the source surface are split into a 3x3 grid, using the corner size for each corner, and the sides and center making up the remaining pixels. The corners are then scaled using `scale` and fit into the corners of the destination rectangle. The sides and center are then stretched into place to cover the remaining destination rectangle.
|
||||
*
|
||||
* \param src the SDL_Surface structure to be copied from.
|
||||
* \param srcrect the SDL_Rect structure representing the rectangle to be
|
||||
* used for the 9-grid, or NULL to use the entire surface.
|
||||
* \param corner_size the size, in pixels, of the corner in `srcrect`.
|
||||
* \param scale the scale used to transform the corner of `srcrect` into the corner of `dstrect`, or 0.0f for an unscaled blit.
|
||||
* \param scaleMode scale algorithm to be used.
|
||||
* \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, or NULL to fill the entire surface.
|
||||
* \returns 0 on success or a negative error code 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.0.0.
|
||||
*
|
||||
* \sa SDL_BlitSurface
|
||||
*/
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_BlitSurface9Grid(SDL_Surface *src, const SDL_Rect *srcrect, int corner_size, float scale, SDL_ScaleMode scaleMode, SDL_Surface *dst, const SDL_Rect *dstrect);
|
||||
|
||||
/**
|
||||
* Map an RGB triple to an opaque pixel value for a surface.
|
||||
*
|
||||
|
Reference in New Issue
Block a user