Skip to content

Instantly share code, notes, and snippets.

@kthakore
Created September 12, 2009 18:57
Show Gist options
  • Save kthakore/185938 to your computer and use it in GitHub Desktop.
Save kthakore/185938 to your computer and use it in GitHub Desktop.
package MyRect;
use base 'SDL::Rect';
sub new {
my $class = shift;
my $x = shift || 0;
my $y = shift || 0;
my $w = shift || 0;
my $h = shift || 0;
my $self = SDL::Rect->new($x, $y, $w, $h);
unless ($$self) {
require Carp;
Carp::croak SDL::GetError();
}
bless $self, $class;
return $self;
}
sub foo {
my $self = shift;
return $self->x;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment