Muskovitz has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am exploring the perl module SDL SDLx::App but everytime i run my script it's getting not responding, i use Win7

#!/usr/bin/perl use strict; use warnings; use SDL; use SDLx::App; my $app=SDLx::App->new(h=>400,w=>400,t=>"SDL Tutorial",exit_on_quit=>1 +); $app->draw_circle([10,10],30,[255,255,0,255]); $app->update; $app->run;
everytime i run my script it hangs i can't drag it the only thing to close the program is to Ctrl+C in cmd. Thanks in advance!

Replies are listed 'Best First'.
Re: My perl SDL app is getting not responding in Windows
by ww (Archbishop) on Mar 13, 2015 at 18:35 UTC

    Perhaps http://search.cpan.org/dist/SDL-2.512/lib/pods/SDLx/App.pod will help?

    SDLx::App controls the root window of the of your SDL based application. It extends the SDL::Surface class, and provides an interface to the window manager oriented functions.

    and

    oop( \%actions ) SDLx::App::loop is a simple event loop method which takes a reference +to a hash of event handler subroutines. The keys of the hash must be +SDL event types such as SDL_QUIT(), SDL_KEYDOWN(), and the like. When + called, the event method recieves as its parameter the event object +used in the loop. Example: my $app = SDLx::App->new( title => "test.app", width => 800, height => 600, depth => 32 ); my %actions = ( SDL_QUIT() => sub { exit(0); }, SDL_KEYDOWN() => sub { print "Key Pressed" }, ); $app->loop( \%actions );