+our $red = SDL::Color->new( 0xff, 0x00, 0x00 );
+our $black = SDL::Color->new( 0x00, 0x00, 0x00 );
+
+my ( $last_x, $last_y ) = ( 0,0 );
+
+my $max_path_length = 100;
+my @path;
+
+sub curve {
+ my $curve = Math::CatmullRom->new( splice @path, 0, $#path + $#path / 2 );
+ my @curve = $curve->curve( $mouse_trashold * $max_path_length );
+ warn "curve ", dump @curve;
+
+ my $i = 0;
+ while ( $i < $#curve ) {
+ my $rect = SDL::Rect->new( -x => int($curve[$i++]), -y => int($curve[$i++]), -w => 1, -h => 1 );
+ $app->fill( $rect, $red );
+ $app->update( $rect );
+ }
+}