package SDL::Video;
use strict;
+use warnings;
+use Carp;
use SDL;
use SDL::Surface;
use SDL::MPEG;
verify (%options, qw/ -name -audio / ) if $SDL::DEBUG;
- my $n = $options{-name} || die "SDL::Video must supply a filename to SDL::Video::new\n";
+ my $n = $options{-name} || croak "SDL::Video must supply a filename to SDL::Video::new\n";
my $a = $options{'-audio'} ? 1 : 0;
my $info = new SDL::MPEG();
}
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);
}
}
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]});
}