use strict;
use warnings;
-use Carp;
use SDL;
sub new {
my $h = $options{-height} || $options{-h} || 0;
my $self = \SDL::NewRect($x,$y,$w,$h);
- croak SDL::GetError() unless $$self;
+ unless ($$self) {
+ require Carp;
+ Carp::croak SDL::GetError();
+ }
bless $self,$class;
return $self;
}
SDL::RectX($$self,@_);
}
-### TODO: see 'left' above
+### TODO: see 'left' above (this is an 'alias' to sub y)
sub top {
my $self = shift;
SDL::RectY($$self,@_);
SDL::RectY($$self,@_);
}
-### TODO: see 'left' above
+### TODO: see 'left' above (this is an 'alias' to sub width)
sub w {
my $self = shift;
SDL::RectW($$self,@_);
SDL::RectW($$self,@_);
}
-### TODO: see 'left' above
+### TODO: see 'left' above (this is an 'alias' to sub height)
sub h {
my $self = shift;
SDL::RectH($$self,@_);