Applied Magnet's Patch
[sdlgit/SDL_perl.git] / lib / SDL / Timer.pm
index aaacdd3..1265841 100644 (file)
@@ -1,10 +1,35 @@
-#      Timer.pm
+#!/usr/bin/env perl
 #
-#      A package for manipulating SDL_Timer *
+# Timer.pm
+#
+# Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
+#
+# ------------------------------------------------------------------------------
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# 
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# ------------------------------------------------------------------------------
+#
+# Please feel free to send questions, suggestions or improvements to:
+#
+#      David J. Goehrig
+#      dgoehrig@cpan.org
 #
-#      Copyright (C) 2002 David J. Goehrig
 
 package SDL::Timer;
+
 use strict;
 use warnings;
 use Carp;
@@ -29,7 +54,7 @@ sub new {
                $$self{-routine} = sub { &$func; $$self{-delay}};
        }
        $$self{-timer} = SDL::NewTimer($$self{-delay},$$self{-routine});
-       croak "Could not create timer, ", SDL::GetError(), "\n"
+       croak "Could not create timer, ", SDL::geterror(), "\n"
                unless ($self->{-timer});
        bless $self,$class;
        return $self;
@@ -56,34 +81,3 @@ sub stop {
 }
 
 1;
-
-__END__;
-
-=pod
-
-
-=head1 NAME
-
-SDL::Timer - a SDL perl extension to handle timers
-
-=head1 SYNOPSIS
-
-  $timer = new SDL::Timer { print "tick"; 4000; } -delay => 4000;
-
-=head1 DESCRIPTION
-
-C<SDL::Timer> provides an abstract interface to the SDL::Timer
-callback code.  SDL::Timer::new requires a subroutine and a delay
-at which is the initial interval between the creation of the
-timer until the first call to the subroutine.  The subroutine
-must return a value which is the delay until the it is called again.
-
-=head1 AUTHOR
-
-David J. Goehrig
-
-=head1 SEE ALSO
-
-L<perl> L<SDL>
-
-=pod