# # SDL::GraphicTool - zooming and rotating graphic tool # # Copyright (C) 2002 Russell E. Valentine # Copyright (C) 2002 David J. Goehrig package SDL::Tool::Graphic; use SDL; require SDL::Surface; sub new { my $proto = shift; my $class = ref($proto) || $proto; $self = {}; bless $self, $class; $self; } sub DESTROY { # nothing to do } sub zoom { my ( $self, $surface, $zoomx, $zoomy, $smooth) = @_; die "SDL::Tool::Graphic::zoom requires an SDL::Surface\n" unless ( ref($surface) && $surface->isa('SDL::Surface')); my $tmp = $$surface; $$surface = SDL::GFXZoom($$surface, $zoomx, $zoomy, $smooth); SDL::FreeSurface($tmp); $surface; } sub rotoZoom { my ( $self, $surface, $angle, $zoom, $smooth) = @_; die "SDL::Tool::Graphic::rotoZoom requires an SDL::Surface\n" unless ( ref($surface) && $surface->isa('SDL::Surface')); my $tmp = $$surface; $$surface = SDL::GFXRotoZoom($$surface, $angle, $zoom, $smooth); SDL::FreeSurface($tmp); $surface; } 1; __END__; =pod =head1 NAME SDL::Tool::Graphic =head1 DESCRIPTION L is a module for zooming and rotating L objects. =head1 METHODS =head2 zoom ( surface, xzoom, yzoom, smooth ) C scales a L along the two axis independently, and returns a new L object. =head2 rotoZoom ( surface, angle, zoom, smooth ) C rotates and fixed axis zooms a L and returns a new L object. =head1 AUTHOR Russell E. Valentine =head1 SEE ALSO L L =cut