Reference

CL_ClipRect(3)

Clipping rectangle class in ClanLib.

NAME

CL_ClipRect - Clipping rectangle class in ClanLib.

DESCRIPTION

This class is used to define clipping regions when drawing graphics to the backbufffer. This is useful if it is too expensive to update the entire screen each time - instead you can define a limited area where everything outside the rectangle should be discarded.

The clipping rectangle is used together with the clipping rect functions in CL_Display and CL_DisplayCard.

CLASS MEMBERS

int m_x1
int m_y1
int m_x2
int m_y2
CL_ClipRect()
CL_ClipRect(
const CL_ClipRect &rect)

CL_ClipRect(
int x1,
int y1,
int x2,
int y2)

bool test_clipped(
const CL_ClipRect &rect)

bool test_unclipped(
const CL_ClipRect &rect)

bool test_all_clipped(
const CL_ClipRect &rect)

CL_ClipRect clip(
const CL_ClipRect &rect)

bool operator ==(
const CL_ClipRect &rect)

MEMBERS WITH DESCRIPTIONS

int m_x1
Description:

Min x-coordinate of the rectangle.

int m_y1
Description:

Min y-coordinate of the rectangle.

int m_x2
Description:

Max x-coordinate of the rectangle - NOT included in clipping area

int m_y2
Description:

Max y-coordinate of the rectangle - NOT included in clipping area

CL_ClipRect()
Description:

Constructs an uninitialized clip rectangle. (x1, y1) and (x2, y2) contain random values, and should be manually initialized before usage of the clip rect.

CL_ClipRect(
const CL_ClipRect &rect)

Description:

Copy constructor.

CL_ClipRect(
int x1,
int y1,
int x2,
int y2)

Parameters:
(x1,y1) - Upper left corner of the rectangle.
(x2,y2) - Lower right corner of the rectangle (not included)

Description:

Constructs a clipping rectangle from (x1,y1) to (x2,y2).

bool test_clipped(
const CL_ClipRect &rect)

Parameters:
rect - The rectangle to be tested.

Description:

Tests if the specified rectangle needs to be clipped with this clip rect.

Return value:

True if the passed rectangle needs to be clipped.

bool test_unclipped(
const CL_ClipRect &rect)

Parameters:
rect - The rectangle to be tested.

Description:

Tests whether the specified rectangle is entirely contained withinthis clip rect.

Return value:

True if the passed rectangle is contained within this rectangle.

bool test_all_clipped(
const CL_ClipRect &rect)

Parameters:
rect - The rectangle to be tested.

Description:

Tests whether all of the specified rectangle is outside this rectangle.

Return value:

True if the entire specified rect is outside this rectangle.

CL_ClipRect clip(
const CL_ClipRect &rect)

Parameters:
rect - The rectangle to be clipped.

Description:

Clips the given rectangle and returns the result.

Return value:

The clipped rectangle.

bool operator ==(
const CL_ClipRect &rect)

Description:

Standard C++ == operator.
friend ostream& operator << (ostream &os, CL_ClipRect &rect);

Return value:

True if specified rectangle equals this rectangle.

SEE ALSO

CL_Display

The DisplayCard wrapper class.

CL_DisplayCard

The DisplayCard class.

All ClanLib API classes can be found in clanlib (3).

AUTHORS

Originally written by Magnus Norddahl <[email protected]> and Martin Starch <[email protected]>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at http://somewhere.in.the.world.org).

See clanlib (3) to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.