Commit | Line | Data |
8bd94773 |
1 | #include "EXTERN.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
4 | |
5 | #ifndef aTHX_ |
6 | #define aTHX_ |
7 | #endif |
8 | |
9 | #include <SDL.h> |
10 | |
11 | |
12 | |
2daadb0f |
13 | MODULE = SDL::Rect PACKAGE = SDL::Rect PREFIX = rect_ |
8bd94773 |
14 | |
15 | SDL_Rect * |
2daadb0f |
16 | rect_new (CLASS, x, y, w, h) |
8bd94773 |
17 | char* CLASS |
2daadb0f |
18 | Sint16 x |
19 | Sint16 y |
20 | Uint16 w |
21 | Uint16 h |
8bd94773 |
22 | CODE: |
23 | RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect)); |
2daadb0f |
24 | RETVAL->x = x; |
25 | RETVAL->y = y; |
26 | RETVAL->w = w; |
27 | RETVAL->h = h; |
8bd94773 |
28 | OUTPUT: |
29 | RETVAL |
30 | |
31 | void |
32 | SetRect(rect, x, y, w, h) |
33 | SDL_Rect *rect |
34 | Sint16 x |
35 | Sint16 y |
36 | Uint16 w |
37 | Uint16 h |
38 | CODE: |
39 | rect->x = x; |
40 | rect->y = y; |
41 | rect->w = w; |
42 | rect->h = h; |
43 | |
44 | |
45 | Sint16 |
2a1ea368 |
46 | rect_RectX ( rect, ... ) |
8bd94773 |
47 | SDL_Rect *rect |
48 | CODE: |
49 | if (items > 1 ) rect->x = SvIV(ST(1)); |
50 | RETVAL = rect->x; |
51 | OUTPUT: |
52 | RETVAL |
53 | |
54 | Sint16 |
2a1ea368 |
55 | rect_RectY ( rect, ... ) |
8bd94773 |
56 | SDL_Rect *rect |
57 | CODE: |
58 | if (items > 1 ) rect->y = SvIV(ST(1)); |
59 | RETVAL = rect->y; |
60 | OUTPUT: |
61 | RETVAL |
62 | |
63 | Uint16 |
2a1ea368 |
64 | rect_RectW ( rect, ... ) |
8bd94773 |
65 | SDL_Rect *rect |
66 | CODE: |
67 | if (items > 1 ) rect->w = SvIV(ST(1)); |
68 | RETVAL = rect->w; |
69 | OUTPUT: |
70 | RETVAL |
71 | |
72 | Uint16 |
2a1ea368 |
73 | rect_RectH ( rect, ... ) |
8bd94773 |
74 | SDL_Rect *rect |
75 | CODE: |
76 | if (items > 1 ) rect->h = SvIV(ST(1)); |
77 | RETVAL = rect->h; |
78 | OUTPUT: |
79 | RETVAL |
80 | |
81 | |
82 | void |
2daadb0f |
83 | rect_DESTROY(self) |
8bd94773 |
84 | SDL_Rect *self |
85 | CODE: |
86 | printf("RectPtr::DESTROY\n"); |
87 | safefree( (char *)self ); |
88 | |
89 | |