Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 0e2a653cb963dd8d28fa9f0a2f0207d7 > files > 412

perl-SDL-2.548.0-4.mga7.armv7hl.rpm

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();