DEADSOFTWARE

sdl: fix build on linux
[d2df-sdl.git] / src / lib / sdl2 / sdlrect.inc
1 //from "sdl_rect.h"
3 type
4 {**
5 * The structure that defines a point
6 *
7 * SDL_EnclosePoints
8 *}
10 PSDL_Point = ^TSDL_Point;
11 TSDL_Point = record
12 x: SInt32;
13 y: SInt32;
14 end;
16 {**
17 * A rectangle, with the origin at the upper left.
18 *
19 * SDL_RectEmpty
20 * SDL_RectEquals
21 * SDL_HasIntersection
22 * SDL_IntersectRect
23 * SDL_UnionRect
24 * SDL_EnclosePoints
25 *}
27 PSDL_Rect = ^TSDL_Rect;
28 TSDL_Rect = record
29 x,y: SInt32;
30 w,h: SInt32;
31 end;
33 {**
34 * Returns true if the rectangle has no area.
35 *}
37 //changed from variant(b�����h!) to TSDL_Rect
38 //maybe PSDL_Rect?
39 function SDL_RectEmpty(X: TSDL_Rect): Boolean;
41 {**
42 * Returns true if the two rectangles are equal.
43 *}
45 function SDL_RectEquals(A: TSDL_Rect; B: TSDL_Rect): Boolean;
47 {**
48 * Determine whether two rectangles intersect.
49 *
50 * SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
51 *}
53 function SDL_HasIntersection(const A: PSDL_Rect; const B: PSDL_Rect): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_HasIntersection' {$ENDIF} {$ENDIF};
55 {**
56 * Calculate the intersection of two rectangles.
57 *
58 * SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
59 *}
61 function SDL_IntersectRect(const A: PSDL_Rect; const B: PSDL_Rect; result: PSDL_Rect): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IntersectRect' {$ENDIF} {$ENDIF};
63 {**
64 * Calculate the union of two rectangles.
65 *}
67 procedure SDL_UnionRect(const A: PSDL_Rect; const B: PSDL_Rect; result: PSDL_Rect) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UnionRect' {$ENDIF} {$ENDIF};
69 {**
70 * Calculate a minimal rectangle enclosing a set of points
71 *
72 * SDL_TRUE if any points were within the clipping rect
73 *}
75 function SDL_EnclosePoints(const points: PSDL_Point; count: SInt32; const clip: PSDL_Rect; result: PSDL_Rect): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_EnclosePoints' {$ENDIF} {$ENDIF};
77 {**
78 * Calculate the intersection of a rectangle and line segment.
79 *
80 * SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
81 *}
83 function SDL_IntersectRectAndLine(const rect: PSDL_Rect; X1: PInt; Y1: PInt; X2: PInt; Y2: PInt): TSDL_Bool cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_IntersectRectAndLine' {$ENDIF} {$ENDIF};