X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSDL%2FCursor.pm;h=58d2dca496129c729a621968ebf4257b82122ef4;hb=bd607ddd553e47f74c6fc157316752d9adab9a13;hp=a8aee2a4743edcf7780812899f84b7c8f18af9c6;hpb=7b6a53a1f5064ca5b8ab0243f7bcf6209e6bf5a4;p=sdlgit%2FSDL_perl.git diff --git a/lib/SDL/Cursor.pm b/lib/SDL/Cursor.pm index a8aee2a..58d2dca 100644 --- a/lib/SDL/Cursor.pm +++ b/lib/SDL/Cursor.pm @@ -40,9 +40,10 @@ sub new { verify (%options, qw/ -data -mask -x -y /) if $SDL::DEBUG; - die SDL::GetError() unless $$self; + my $self = \SDL::NewCursor($options{-data},$options{-mask}, $options{-x},$options{-y}); + croak SDL::GetError() unless $$self; bless $self, $class; $self; } @@ -68,6 +69,7 @@ sub get () { sub show ($;$) { my ($self,$toggle) = @_; + $toggle = 0 unless defined $toggle; SDL::ShowCursor($toggle); }