Any code that is not marketed is dead code
--mst
You need the new code from the
redesign branch to use this .
#!/usr/bin/env perl
use SDL;
use SDL::Events;
use SDL::Event;
use SDL::Video;
SDL::init(SDL_INIT_VIDEO);
my $display = SDL::Video::set_video_mode(640,480,32, SDL_SWSURFACE );
my $event = SDL::Event->new();
while(1)
{
SDL::Events::pump_events();
if(SDL::Events::poll_event($event) && $event->type == SDL_ACTIVEEVENT)
{
print "Hello Mouse!!!\n" if ($event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
print "Bye Mouse!!!\n" if (!$event->active_gain && ($event->active_state == SDL_APPMOUSEFOCUS) );
}
exit if($event->type == SDL_QUIT);
}