File: app.pl

package info (click to toggle)
libsdl-perl 2.548-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,972 kB
  • sloc: perl: 13,985; ansic: 583; makefile: 35
file content (21 lines) | stat: -rw-r--r-- 408 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use SDL::Event;
use SDLx::App;

my $app = SDLx::App->new(
	title  => "Lines",
	width  => 640,
	height => 480,
);



sub draw_lines { $app->draw_line( [ 0, 0 ], [ rand( $app->w ), rand( $app->h ) ], 0xFFFFFFFF ); $app->update(); }

sub event_handle { my $e = shift; $_[0]->stop if ( $e->type == SDL_QUIT ); }

$app->add_event_handler( \&event_handle );
$app->add_show_handler( \&draw_lines );

$app->run();