include/SDL_rect.h
changeset 3536 0267b8b1595c
parent 3407 d3baf5ac4e37
child 3697 f7b03b6838cb
--- 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.