oops
[sdlgit/SDL_perl.git] / exp / SDL / Rect / Rect.xs
CommitLineData
d0eab7ef 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
6e437027 13MODULE = SDL PACKAGE = Rect
14PROTOTYPES: DISABLE
d0eab7ef 15
16
17SDL_Rect *
18NewRect ( x, y, w, h )
19 Sint16 x
20 Sint16 y
21 Uint16 w
22 Uint16 h
23 CODE:
24 RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect));
25 RETVAL->x = x;
26 RETVAL->y = y;
27 RETVAL->w = w;
28 RETVAL->h = h;
29 OUTPUT:
30 RETVAL
31
32Sint16
33RectX ( rect, ... )
34 SDL_Rect *rect
35 CODE:
36 if (items > 1 ) rect->x = SvIV(ST(1));
37 RETVAL = rect->x;
38 OUTPUT:
39 RETVAL
40
41Sint16
42RectY ( rect, ... )
43 SDL_Rect *rect
44 CODE:
45 if (items > 1 ) rect->y = SvIV(ST(1));
46 RETVAL = rect->y;
47 OUTPUT:
48 RETVAL
49
50Uint16
51RectW ( rect, ... )
52 SDL_Rect *rect
53 CODE:
54 if (items > 1 ) rect->w = SvIV(ST(1));
55 RETVAL = rect->w;
56 OUTPUT:
57 RETVAL
58
59Uint16
60RectH ( rect, ... )
61 SDL_Rect *rect
62 CODE:
63 if (items > 1 ) rect->h = SvIV(ST(1));
64 RETVAL = rect->h;
65 OUTPUT:
66 RETVAL
67
6e437027 68MODULE = SDL PACKAGE = SDL_RectPtr PREFIX = Rect_
d0eab7ef 69
70void
71Rect_DESTROY(rect)
72 SDL_Rect *rect
73 CODE:
74 printf("RectPtr::DESTROY\n");
75 safefree( rect );
76
77