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
AG_RECT(3) FreeBSD Library Functions Manual AG_RECT(3)

AG_Rect
agar rectangle structure

#include <agar/core.h>
#include <agar/gui.h>

Many functions in Agar accept AG_Rect parameters. This structure describes a two-dimensional integer rectangle:
typedef struct ag_rect {
	int x, y;
	int w, h;
} AG_Rect;

The alternate AG_Rect2 structure also stores the two endpoints explicitely:

typedef struct ag_rect2 {
	int x1, y1;
	int w, h;
	int x2, y2;
} AG_Rect2;

AG_Rect
AG_RECT(int x, int y, int w, int h);


AG_Rect2
AG_RECT2(int x, int y, int w, int h);


AG_Rect
AG_ReadRect(AG_DataSource *ds);


AG_Rect2
AG_ReadRect2(AG_DataSource *ds);


void
AG_WriteRect(AG_DataSource *ds, AG_Rect r);


void
AG_WriteRect2(AG_DataSource *ds, AG_Rect2 r);


AG_Rect
AG_Rect2ToRect(AG_Rect2 r);


AG_Rect2
AG_RectToRect2(AG_Rect r);


AG_Rect
AG_RectIntersect(const AG_Rect *a, const AG_Rect *b);


AG_Rect2
AG_RectIntersect2(const AG_Rect2 *a, const AG_Rect2 *b);


int
AG_RectInside(const AG_Rect *r, int x, int y);


int
AG_RectInside2(const AG_Rect2 *r, int x, int y);


int
AG_RectCompare(const AG_Rect *a, const AG_Rect *b);


int
AG_RectCompare2(const AG_Rect2 *a, const AG_Rect2 *b);


void
AG_RectSize(AG_Rect *r, int w, int h);


void
AG_RectSize2(AG_Rect2 *r, int w, int h);


void
AG_RectTranslate(AG_Rect *r, int x, int y);


void
AG_RectTranslate2(AG_Rect2 *r, int x, int y);

The AG_RECT() routine returns an AG_Rect structure initialized to the given coordinates x, y and dimensions w, h. The AG_RECT2() variant returns an AG_Rect2.

The AG_ReadRect() function loads a rectangle from the given AG_DataSource(3). AG_WriteRect() writes a rectangle to a data source.

The AG_RectToRect2() and AG_Rect2ToRect() routines convert between the AG_Rect and AG_Rect2 formats.

AG_RectIntersect() and AG_RectIntersect2() return intersection of rectangles a and b.

AG_RectInside() and AG_RectInside() return 1 if the point x, y lies inside of rectangle r.

The AG_RectCompare() and AG_RectCompare2() routines return 0 if both rectangles possess the same coordinates and dimensions.

The AG_RectSize() and AG_RectSize2() routines resize a rectangle to the specified dimensions.

AG_RectTranslate() and AG_RectTranslate2() translate a rectangle by the specified amount.

AG_Intro(3), AG_Widget(3)

The AG_Rect structure first appeared in Agar 1.3.
October 12, 2008 FreeBSD 13.1-RELEASE

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.