#modified version of SDL-2.548/examples/SDLx/app.pl use SDL::Event; use SDLx::App; my $app = SDLx::App->new( title => "Lines", width => 640, height => 480, resizeable >'on', ); sub draw_lines { $app->draw_line( [ 0, 0 ], [ rand( $app->w ), rand( $app->h ) ], 0xFFFFFFFF ); $app->update(); } sub event_handle { my $event = shift; my $app = shift; $app->stop if ( $event->type == SDL_QUIT ); if($event->type==SDL_VIDEORESIZE){ $app->resize($event->resize_w,$event->resize_h); } } $app->add_event_handler( \&event_handle ); $app->add_show_handler( \&draw_lines ); $app->run();