Commit | Line | Data |
---|---|---|
a1b835c1 | 1 | =pod |
2 | =cut | |
bfd90409 | 3 | package SDL::Rect; |
a1b835c1 | 4 | use strict; |
5 | use warnings; | |
e4ab5b2e | 6 | require Exporter; |
7 | require DynaLoader; | |
bfd90409 | 8 | |
a1b835c1 | 9 | our @ISA = qw(Exporter DynaLoader); |
e4ab5b2e | 10 | # Items to export into callers namespace by default. Note: do not export |
11 | # names by default without a very good reason. Use EXPORT_OK instead. | |
12 | # Do not simply export all your public functions/methods/constants. | |
e4ab5b2e | 13 | bootstrap SDL::Rect; |
14 | ||
a1b835c1 | 15 | =head1 Perl binding to C stuct Rect |
16 | =cut | |
17 | ||
e4ab5b2e | 18 | # Preloaded methods go here. |
bfd90409 | 19 | |
96493475 | 20 | # TODO: mangle with the symbol table to create an alias |
21 | # to sub x. We could call x from inside the sub but that | |
22 | # would be another call and rects are a time-critical object. | |
23 | sub left { | |
24 | my $self = shift; | |
e4ab5b2e | 25 | RectX($self,@_); |
96493475 | 26 | } |
27 | ||
bfd90409 | 28 | sub x { |
29 | my $self = shift; | |
e4ab5b2e | 30 | RectX($self,@_); |
bfd90409 | 31 | } |
32 | ||
69e6e191 | 33 | ### TODO: see 'left' above (this is an 'alias' to sub y) |
96493475 | 34 | sub top { |
35 | my $self = shift; | |
e4ab5b2e | 36 | RectY($self,@_); |
96493475 | 37 | } |
38 | ||
bfd90409 | 39 | sub y { |
40 | my $self = shift; | |
e4ab5b2e | 41 | RectY($self,@_); |
bfd90409 | 42 | } |
43 | ||
69e6e191 | 44 | ### TODO: see 'left' above (this is an 'alias' to sub width) |
96493475 | 45 | sub w { |
46 | my $self = shift; | |
e4ab5b2e | 47 | RectW($self,@_); |
96493475 | 48 | } |
49 | ||
bfd90409 | 50 | sub width { |
51 | my $self = shift; | |
e4ab5b2e | 52 | RectW($self,@_); |
bfd90409 | 53 | } |
54 | ||
69e6e191 | 55 | ### TODO: see 'left' above (this is an 'alias' to sub height) |
96493475 | 56 | sub h { |
57 | my $self = shift; | |
e4ab5b2e | 58 | RectH($self,@_); |
96493475 | 59 | } |
60 | ||
bfd90409 | 61 | sub height { |
62 | my $self = shift; | |
e4ab5b2e | 63 | RectH($self,@_); |
bfd90409 | 64 | } |
65 | ||
bfd90409 | 66 | |
e4ab5b2e | 67 | # Autoload methods go after __END__, and are processed by the autosplit program. |
23dbccd4 | 68 | |
e4ab5b2e | 69 | 1; |
70 | __END__ |