X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSDL%2FCursor.pm;h=58d2dca496129c729a621968ebf4257b82122ef4;hb=5ccf0b03b8b768a2b11d271f45929e4098c7374a;hp=847ee652b84a9df141348dc607ffa89d97b3fc8a;hpb=bfd90409c307d445ed6fec5cce6344b1e3d1be05;p=sdlgit%2FSDL_perl.git diff --git a/lib/SDL/Cursor.pm b/lib/SDL/Cursor.pm index 847ee65..58d2dca 100644 --- a/lib/SDL/Cursor.pm +++ b/lib/SDL/Cursor.pm @@ -30,6 +30,8 @@ package SDL::Cursor; use strict; +use warnings; +use Carp; sub new { my $proto = shift; @@ -38,9 +40,10 @@ sub new { verify (%options, qw/ -data -mask -x -y /) if $SDL::DEBUG; + my $self = \SDL::NewCursor($options{-data},$options{-mask}, $options{-x},$options{-y}); - die SDL::GetError() unless $$self; + croak SDL::GetError() unless $$self; bless $self, $class; $self; } @@ -66,6 +69,7 @@ sub get () { sub show ($;$) { my ($self,$toggle) = @_; + $toggle = 0 unless defined $toggle; SDL::ShowCursor($toggle); }