GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SDLmm::SRect(3) FreeBSD Library Functions Manual SDLmm::SRect(3)

SDLmm::SRect - This enhanced version of SDL_Rect includes a number of handy short-hand constructors. Since the class is derived from the SDL_Rect struct, it can be used in any context where an SDL_Rect is valid.

#include <sdlmm_srect.h>

Inherits SDL_Rect.


SRect ()
Default constructor which creates an empty SRect (xywh variables set to sero). SRect (const SRect &rect)
This is the copy constructor. Simply initializes the value of an SRect to that of another SRect. SRect (const SDL_Rect &rect)
Constructor which initializes the class from an SDL_Rect struct. SRect (const SPoint &point)
Constructor which initializes the class from an SPoint object. SRect (const SPoint &upper_left_point, const SPoint &bottom_right_point)
Construct an object using the given upper left and bottom right corners. SRect (const SPoint &point, Uint16 nw, Uint16 nh)
Constructor which initializes the class from an SPoint object and integer values. SRect (Sint16 nx, Sint16 ny, Uint16 nw, Uint16 nh)
Constructor which initializes the class from integer values. SRect (Uint16 nw, Uint16 nh)
Constructor which initializes the width and height from integer values. SRect& operator= (const SDL_Rect &rect)
Set the value of an SRect to that of an existing SDL_Rect or SRect. bool operator== (const SDL_Rect &rect) const
Compare two rectangles for equality. SPoint GetUpperLeft () const
Get the coordinates for the upper left corner of the SRect. SPoint GetUpperRight () const
Get the coordinates for the upper right corner of the SRect. SPoint GetBottomLeft () const
Get the coordinates for the bottom left corner of the SRect. SPoint GetBottomRight () const
Get the coordinates for the bottom right corner of the SRect.

This enhanced version of SDL_Rect includes a number of handy short-hand constructors. Since the class is derived from the SDL_Rect struct, it can be used in any context where an SDL_Rect is valid.

Todo:
Extend the class with useful utility functions in regards to rectangles like intersections.

Author:
David Hedbor <david@hedbor.org>

Default constructor which creates an empty SRect (xywh variables set to sero).

This is the copy constructor. Simply initializes the value of an SRect to that of another SRect.

Parameters:

rect
an existing SRect object.

Constructor which initializes the class from an SDL_Rect struct.

Parameters:

rect
an existing SDL_Rect struct.

Constructor which initializes the class from an SPoint object.

The x and y values will be initialized with the x/y values of the SPoint. h and w will be set to zero.

Parameters:

point
reference to an existing SPoint object.

Construct an object using the given upper left and bottom right corners.

Parameters:

upper_left_point
SPoint for the upper right corner of the rectangle
bottom_right_point
SPoint for the bottom right corner of the rectangle

Constructor which initializes the class from an SPoint object and integer values.

The x and y values will be initialized with the x/y values of the SPoint and the dimensions from nw and nh.

Parameters:

nw, nh
the width and height of the rectangle
point
reference to an existing SPoint object for the upper right corner.

Constructor which initializes the class from integer values.

Parameters:

nx, ny
position of the upper left corner of the rectangle
nw, nh
the width and height of the rectangle

Constructor which initializes the width and height from integer values.

The x/y coordinates for the upper left corner will be set to zero.

Parameters:

nw, nh
the width and height of the rectangle

Get the coordinates for the bottom left corner of the SRect.

Returns:
SPoint object

Get the coordinates for the bottom right corner of the SRect.

Returns:
SPoint object

Get the coordinates for the upper left corner of the SRect.

Returns:
SPoint object

Get the coordinates for the upper right corner of the SRect.

Returns:
SPoint object

Set the value of an SRect to that of an existing SDL_Rect or SRect.

Compare two rectangles for equality.

Returns:
true if x / y coordinates and h / w are identical in both rectangles.

Generated automatically by Doxygen for SDLmm from the source code.
16 Jul 2001 SDLmm

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.