diff include/SDL_rect.h @ 3536:0267b8b1595c

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()
author Sam Lantinga <slouken@libsdl.org>
date Wed, 09 Dec 2009 15:56:56 +0000
parents d3baf5ac4e37
children f7b03b6838cb
line wrap: on
line diff
--- a/include/SDL_rect.h	Mon Dec 07 10:08:24 2009 +0000
+++ b/include/SDL_rect.h	Wed Dec 09 15:56:56 2009 +0000
@@ -43,6 +43,17 @@
 #endif
 
 /**
+ *  \brief  The structure that defines a point
+ *
+ *  \sa SDL_EnclosePoints
+ */
+typedef struct
+{
+    int x;
+    int y;
+} SDL_Point;
+
+/**
  *  \brief A rectangle, with the origin at the upper left.
  *  
  *  \sa SDL_RectEmpty
@@ -50,6 +61,7 @@
  *  \sa SDL_HasIntersection
  *  \sa SDL_IntersectRect
  *  \sa SDL_UnionRect
+ *  \sa SDL_EnclosePoints
  */
 typedef struct SDL_Rect
 {
@@ -93,6 +105,16 @@
                                            SDL_Rect * result);
 
 /**
+ *  \brief Calculate a minimal rectangle enclosing a set of points
+ *
+ *  \return SDL_TRUE if any points were within the clipping rect
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
+                                                   int count,
+                                                   const SDL_Rect * clip,
+                                                   SDL_Rect * result);
+
+/**
  *  \brief Calculate the intersection of a rectangle and line segment.
  *  
  *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.