<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>SDLmm::SRect class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Generated by Doxygen 1.2.8.1 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>SDLmm::SRect Class Reference</h1>This enhanced version of <em><a class="el" href="structSDL__Rect.html">SDL_Rect</a></em> includes a number of handy short-hand constructors. Since the class is derived from the <a class="el" href="structSDL__Rect.html">SDL_Rect</a> struct, it can be used in any context where an <em><a class="el" href="structSDL__Rect.html">SDL_Rect</a></em> is valid. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="sdlmm__srect_8h-source.html">sdlmm_srect.h</a>></code> <p> Inheritance diagram for SDLmm::SRect:<p><center><img src="classSDLmm_1_1SRect__inherit__graph.gif" border="0" usemap="#SDLmm::SRect_inherit_map" alt="Inheritance graph"></center> <map name="SDLmm::SRect_inherit_map"> <area href="structSDL__Rect.html" shape="rect" coords="15,11,84,30"> </map> <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classSDLmm_1_1SRect-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a0">SRect</a> ()</td></tr> <tr><td> </td><td><font size=-1><em>Default constructor which creates an empty <a class="el" href="classSDLmm_1_1SRect.html">SRect</a> (xywh variables set to sero).</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a1">SRect</a> (const SRect &rect)</td></tr> <tr><td> </td><td><font size=-1><em>This is the copy constructor. Simply initializes the value of an <a class="el" href="classSDLmm_1_1SRect.html">SRect</a> to that of another <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a2">SRect</a> (const <a class="el" href="structSDL__Rect.html">SDL_Rect</a> &rect)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor which initializes the class from an <a class="el" href="structSDL__Rect.html">SDL_Rect</a> struct.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a3">SRect</a> (const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> &point)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor which initializes the class from an <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a4">SRect</a> (const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> &upper_left_point, const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> &bottom_right_point)</td></tr> <tr><td> </td><td><font size=-1><em>Construct an object using the given upper left and bottom right corners.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a5">SRect</a> (const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> &point, Uint16 nw, Uint16 nh)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor which initializes the class from an <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object and integer values.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a6">SRect</a> (Sint16 nx, Sint16 ny, Uint16 nw, Uint16 nh)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor which initializes the class from integer values.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a7">SRect</a> (Uint16 nw, Uint16 nh)</td></tr> <tr><td> </td><td><font size=-1><em>Constructor which initializes the width and height from integer values.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>SRect& </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a8">operator=</a> (const <a class="el" href="structSDL__Rect.html">SDL_Rect</a> &rect)</td></tr> <tr><td> </td><td><font size=-1><em>Set the value of an <a class="el" href="classSDLmm_1_1SRect.html">SRect</a> to that of an existing <a class="el" href="structSDL__Rect.html">SDL_Rect</a> or <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a9">operator==</a> (const <a class="el" href="structSDL__Rect.html">SDL_Rect</a> &rect) const</td></tr> <tr><td> </td><td><font size=-1><em>Compare two rectangles for equality.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a10">GetUpperLeft</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Get the coordinates for the upper left corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>.</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a11">GetUpperRight</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Get the coordinates for the upper right corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a12">GetBottomLeft</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Get the coordinates for the bottom left corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> </td><td valign=bottom><a class="el" href="classSDLmm_1_1SRect.html#a13">GetBottomRight</a> () const</td></tr> <tr><td> </td><td><font size=-1><em>Get the coordinates for the bottom right corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> This enhanced version of <em><a class="el" href="structSDL__Rect.html">SDL_Rect</a></em> includes a number of handy short-hand constructors. Since the class is derived from the <a class="el" href="structSDL__Rect.html">SDL_Rect</a> struct, it can be used in any context where an <em><a class="el" href="structSDL__Rect.html">SDL_Rect</a></em> is valid. <p> <dl compact><dt> <b><a class="el" href="todo.html#_todo000001">Todo: </a></b><dd> Extend the class with useful utility functions in regards to rectangles like intersections.</dl> <dl compact><dt> <b>Author: </b><dd> David Hedbor <<a href="mailto:david@hedbor.org">david@hedbor.org</a>> </dl> <p> <hr><h2>Constructor & Destructor Documentation</h2> <a name="a0" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Default constructor which creates an empty <a class="el" href="classSDLmm_1_1SRect.html">SRect</a> (xywh variables set to sero). <p> </td> </tr> </table> <a name="a1" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> const SRect & <em>rect</em> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> This is the copy constructor. Simply initializes the value of an <a class="el" href="classSDLmm_1_1SRect.html">SRect</a> to that of another <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>. <p> <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>rect</em> </td><td> an existing <a class="el" href="classSDLmm_1_1SRect.html">SRect</a> object. </td></tr> </table> </dl> </td> </tr> </table> <a name="a2" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> const <a class="el" href="structSDL__Rect.html">SDL_Rect</a> & <em>rect</em> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor which initializes the class from an <a class="el" href="structSDL__Rect.html">SDL_Rect</a> struct. <p> <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>rect</em> </td><td> an existing <a class="el" href="structSDL__Rect.html">SDL_Rect</a> struct. </td></tr> </table> </dl> </td> </tr> </table> <a name="a3" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> & <em>point</em> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor which initializes the class from an <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object. <p> The x and y values will be initialized with the x/y values of the <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a>. h and w will be set to zero. <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>point</em> </td><td> reference to an existing <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object. </td></tr> </table> </dl> </td> </tr> </table> <a name="a4" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> & <em>upper_left_point</em>, </b></td> </tr> <tr> <td></td> <td><b> const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> & <em>bottom_right_point</em> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Construct an object using the given upper left and bottom right corners. <p> <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>upper_left_point</em> </td><td> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> for the upper right corner of the rectangle </td></tr> <tr><td valign=top><em>bottom_right_point</em> </td><td> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> for the bottom right corner of the rectangle </td></tr> </table> </dl> </td> </tr> </table> <a name="a5" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> const <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> & <em>point</em>, </b></td> </tr> <tr> <td></td> <td><b> Uint16 <em>nw</em>, </b></td> </tr> <tr> <td></td> <td><b> Uint16 <em>nh</em> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor which initializes the class from an <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object and integer values. <p> The x and y values will be initialized with the x/y values of the <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> and the dimensions from nw and nh. <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>nw, nh</em> </td><td> the width and height of the rectangle </td></tr> <tr><td valign=top><em>point</em> </td><td> reference to an existing <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object for the upper right corner. </td></tr> </table> </dl> </td> </tr> </table> <a name="a6" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> Sint16 <em>nx</em>, </b></td> </tr> <tr> <td></td> <td><b> Sint16 <em>ny</em>, </b></td> </tr> <tr> <td></td> <td><b> Uint16 <em>nw</em>, </b></td> </tr> <tr> <td></td> <td><b> Uint16 <em>nh</em> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor which initializes the class from integer values. <p> <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>nx, ny</em> </td><td> position of the upper left corner of the rectangle </td></tr> <tr><td valign=top><em>nw, nh</em> </td><td> the width and height of the rectangle </td></tr> </table> </dl> </td> </tr> </table> <a name="a7" doxytag="SDLmm::SRect::SRect"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SDLmm::SRect::SRect ( </b></td> <td valign="bottom"><b> Uint16 <em>nw</em>, </b></td> </tr> <tr> <td></td> <td><b> Uint16 <em>nh</em> ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Constructor which initializes the width and height from integer values. <p> The x/y coordinates for the upper left corner will be set to zero. <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>nw, nh</em> </td><td> the width and height of the rectangle </td></tr> </table> </dl> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="a12" doxytag="SDLmm::SRect::GetBottomLeft"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> SDLmm::SRect::GetBottomLeft ( </b></td> <td valign="bottom"><b> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Get the coordinates for the bottom left corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>. <p> <dl compact><dt> <b>Returns: </b><dd> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object </dl> </td> </tr> </table> <a name="a13" doxytag="SDLmm::SRect::GetBottomRight"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> SDLmm::SRect::GetBottomRight ( </b></td> <td valign="bottom"><b> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Get the coordinates for the bottom right corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>. <p> <dl compact><dt> <b>Returns: </b><dd> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object </dl> </td> </tr> </table> <a name="a10" doxytag="SDLmm::SRect::GetUpperLeft"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> SDLmm::SRect::GetUpperLeft ( </b></td> <td valign="bottom"><b> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Get the coordinates for the upper left corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>. <p> <dl compact><dt> <b>Returns: </b><dd> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object </dl> </td> </tr> </table> <a name="a11" doxytag="SDLmm::SRect::GetUpperRight"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> SDLmm::SRect::GetUpperRight ( </b></td> <td valign="bottom"><b> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Get the coordinates for the upper right corner of the <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>. <p> <dl compact><dt> <b>Returns: </b><dd> <a class="el" href="classSDLmm_1_1SPoint.html">SPoint</a> object </dl> </td> </tr> </table> <a name="a8" doxytag="SDLmm::SRect::operator="></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> SRect & SDLmm::SRect::operator= ( </b></td> <td valign="bottom"><b> const <a class="el" href="structSDL__Rect.html">SDL_Rect</a> & <em>rect</em> )<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Set the value of an <a class="el" href="classSDLmm_1_1SRect.html">SRect</a> to that of an existing <a class="el" href="structSDL__Rect.html">SDL_Rect</a> or <a class="el" href="classSDLmm_1_1SRect.html">SRect</a>. <p> </td> </tr> </table> <a name="a9" doxytag="SDLmm::SRect::operator=="></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> bool SDLmm::SRect::operator== ( </b></td> <td valign="bottom"><b> const <a class="el" href="structSDL__Rect.html">SDL_Rect</a> & <em>rect</em> ) const<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Compare two rectangles for equality. <p> <dl compact><dt> <b>Returns: </b><dd> true if x / y coordinates and h / w are identical in both rectangles. </dl> </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="sdlmm__srect_8h-source.html">sdlmm_srect.h</a><li><a class="el" href="sdlmm__srect_8cpp.html">sdlmm_srect.cpp</a></ul> <hr> <table cellspacing=10 cellpadding=0 border=0 width=100%> <tr valign=middle><td><font size=-1>Documentation automatically generated by <a href="http://www.stack.nl/~dimitri/doxygen/"><img border=0 align=center src="doxygen.gif" alt="doxygen"></a> written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>.</font></td> <td align=right><font size=-1>Project hosted at <br><a href="http://sourceforge.net"><img align=middle src="http://sourceforge.net/sflogo.php?group_id=25445&type=1" width="88" height="31" border="0" alt="Hosted by SourceForge"></a></font></td></tr></table>