Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move perl_* into perl
- Loading branch information
eXerigumo Clanjor (哆啦比猫)
committed
Oct 27, 2012
1 parent
e2bcd1b
commit 6acb282
Showing
20 changed files
with
371 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env perl | ||
# see http://www.gamasutra.com/resource_guide/20030121/jacobson_03.shtml | ||
|
||
use strict; | ||
use warnings; | ||
use vector; | ||
|
||
use SDL; | ||
use SDL::Event; | ||
use SDLx::App; | ||
|
||
my $app = SDLx::App->new( | ||
width => 400, | ||
height => 400, | ||
title => 'Cloth'); | ||
|
||
$app->add_event_handler(\&event); | ||
#$app->add_move_handler (\&move); | ||
$app->add_show_handler (\&render); | ||
&init; | ||
$app->run(); | ||
|
||
sub event { | ||
my $event = shift; | ||
my $controller = shift; | ||
$controller->stop if $event->type == SDL_QUIT; | ||
if ($event->type == SDL_MOUSEMOTION) { | ||
# $target->{x} = $event->button_x; | ||
# $target->{y} = $event->button_y; | ||
} | ||
} | ||
|
||
sub init | ||
{ | ||
} | ||
|
||
sub drawp { | ||
# my $p = shift; | ||
# $app->draw_circle_filled([$p->{x}, $p->{y}], 2, [255, 0, 0, 255]); | ||
} | ||
|
||
sub render { | ||
# my ($delta, $app) = @_; | ||
# $app->draw_rect([0, 0, $app->w, $app->h], 0); # clear screen | ||
# foreach my $i (0..$#ps) { | ||
# drawp $ps[$i]; | ||
# } | ||
$app->update(); | ||
} | ||
|
Oops, something went wrong.