X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSDL%2FVideo.pm;h=494679c78790a392059b489fd30e6433d421fd41;hb=bd607ddd553e47f74c6fc157316752d9adab9a13;hp=a97bf0a9d50a82cad32326e59ccfa1ed40656fc2;hpb=bfd90409c307d445ed6fec5cce6344b1e3d1be05;p=sdlgit%2FSDL_perl.git diff --git a/lib/SDL/Video.pm b/lib/SDL/Video.pm index a97bf0a..494679c 100644 --- a/lib/SDL/Video.pm +++ b/lib/SDL/Video.pm @@ -31,6 +31,8 @@ package SDL::Video; use strict; +use warnings; +use Carp; use SDL; use SDL::Surface; use SDL::MPEG; @@ -47,7 +49,7 @@ sub new { my $info = new SDL::MPEG(); my $self = \SDL::NewSMPEG($n,$$info,$a); - die SDL::GetError() unless $$self; + croak SDL::GetError() unless $$self; bless $self,$class; $self->audio(1); $self->video(1); @@ -75,7 +77,7 @@ sub volume { } sub display { - die "SDL::Video::Display requires a SDL::Surface\n" unless $_[1]->isa('SDL::Surface'); + croak "SDL::Video::Display requires a SDL::Surface\n" unless $_[1]->isa('SDL::Surface'); SDL::SMPEGSetDisplay( ${$_[0]}, ${$_[1]}, 0); } @@ -114,7 +116,7 @@ sub loop { } sub region { - die "SDL::Video::region requires a SDL::Rect\n" unless $_[1]->isa('SDL::Rect'); + croak "SDL::Video::region requires a SDL::Rect\n" unless $_[1]->isa('SDL::Rect'); SDL::SMPEGDisplayRegion(${$_[0]},${$_[1]}); }