Added interfaces for batch drawing of points, lines and rects:

SDL_DrawPoints()
    SDL_BlendPoints()
    SDL_BlendLines()
    SDL_DrawLines()
    SDL_FillRects()
    SDL_BlendRects()
    SDL_RenderPoints()
    SDL_RenderLines()
    SDL_RenderRects()
Renamed SDL_RenderFill() to SDL_RenderRect()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404279
This commit is contained in:
Sam Lantinga 2009-12-09 15:56:56 +00:00
parent 304a6bbb6c
commit 8ee9720297
26 changed files with 1236 additions and 567 deletions

View file

@ -405,6 +405,8 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
*/
extern DECLSPEC int SDLCALL SDL_DrawPoint
(SDL_Surface * dst, int x, int y, Uint32 color);
extern DECLSPEC int SDLCALL SDL_DrawPoints
(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
/**
* Blends a point with an RGBA value.
@ -415,8 +417,11 @@ extern DECLSPEC int SDLCALL SDL_DrawPoint
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_BlendPoint
(SDL_Surface * dst, int x, int y, int blendMode,
Uint8 r, Uint8 g, Uint8 b, Uint8 a);
(SDL_Surface * dst, int x, int y,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern DECLSPEC int SDLCALL SDL_BlendPoints
(SDL_Surface * dst, const SDL_Point * points, int count,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/**
* Draws a line with \c color.
@ -428,6 +433,8 @@ extern DECLSPEC int SDLCALL SDL_BlendPoint
*/
extern DECLSPEC int SDLCALL SDL_DrawLine
(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
extern DECLSPEC int SDLCALL SDL_DrawLines
(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
/**
* Blends an RGBA value along a line.
@ -435,16 +442,16 @@ extern DECLSPEC int SDLCALL SDL_DrawLine
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_BlendLine
(SDL_Surface * dst, int x1, int y1, int x2, int y2, int blendMode,
Uint8 r, Uint8 g, Uint8 b, Uint8 a);
(SDL_Surface * dst, int x1, int y1, int x2, int y2,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern DECLSPEC int SDLCALL SDL_BlendLines
(SDL_Surface * dst, const SDL_Point * points, int count,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/**
* Performs a fast fill of the given rectangle with \c color.
*
* The given rectangle is clipped to the destination surface clip area
* and the final fill rectangle is saved in the passed in pointer.
*
* If \c dstrect is NULL, the whole surface will be filled with \c color.
* If \c rect is NULL, the whole surface will be filled with \c color.
*
* The color should be a pixel of the format used by the surface, and
* can be generated by the SDL_MapRGB() function.
@ -452,21 +459,23 @@ extern DECLSPEC int SDLCALL SDL_BlendLine
* \return 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_FillRect
(SDL_Surface * dst, SDL_Rect * dstrect, Uint32 color);
(SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
extern DECLSPEC int SDLCALL SDL_FillRects
(SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color);
/**
* Blends an RGBA value into the given rectangle.
*
* The given rectangle is clipped to the destination surface clip area
* and the final fill rectangle is saved in the passed in pointer.
*
* If \c dstrect is NULL, the whole surface will be filled with \c color.
* If \c rect is NULL, the whole surface will be filled with \c color.
*
* \return This function returns 0 on success, or -1 on error.
*/
extern DECLSPEC int SDLCALL SDL_BlendRect
(SDL_Surface * dst, SDL_Rect * dstrect, int blendMode, Uint8 r, Uint8 g,
Uint8 b, Uint8 a);
(SDL_Surface * dst, const SDL_Rect * rect,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern DECLSPEC int SDLCALL SDL_BlendRects
(SDL_Surface * dst, const SDL_Rect ** rects, int count,
int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
/**
* Performs a fast blit from the source surface to the destination surface.