include/SDL_rect.h
changeset 3536 0267b8b1595c
parent 3407 d3baf5ac4e37
child 3697 f7b03b6838cb
     1.1 --- a/include/SDL_rect.h	Mon Dec 07 10:08:24 2009 +0000
     1.2 +++ b/include/SDL_rect.h	Wed Dec 09 15:56:56 2009 +0000
     1.3 @@ -43,6 +43,17 @@
     1.4  #endif
     1.5  
     1.6  /**
     1.7 + *  \brief  The structure that defines a point
     1.8 + *
     1.9 + *  \sa SDL_EnclosePoints
    1.10 + */
    1.11 +typedef struct
    1.12 +{
    1.13 +    int x;
    1.14 +    int y;
    1.15 +} SDL_Point;
    1.16 +
    1.17 +/**
    1.18   *  \brief A rectangle, with the origin at the upper left.
    1.19   *  
    1.20   *  \sa SDL_RectEmpty
    1.21 @@ -50,6 +61,7 @@
    1.22   *  \sa SDL_HasIntersection
    1.23   *  \sa SDL_IntersectRect
    1.24   *  \sa SDL_UnionRect
    1.25 + *  \sa SDL_EnclosePoints
    1.26   */
    1.27  typedef struct SDL_Rect
    1.28  {
    1.29 @@ -93,6 +105,16 @@
    1.30                                             SDL_Rect * result);
    1.31  
    1.32  /**
    1.33 + *  \brief Calculate a minimal rectangle enclosing a set of points
    1.34 + *
    1.35 + *  \return SDL_TRUE if any points were within the clipping rect
    1.36 + */
    1.37 +extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points,
    1.38 +                                                   int count,
    1.39 +                                                   const SDL_Rect * clip,
    1.40 +                                                   SDL_Rect * result);
    1.41 +
    1.42 +/**
    1.43   *  \brief Calculate the intersection of a rectangle and line segment.
    1.44   *  
    1.45   *  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.