Skip to content

Commit

Permalink
added warns and stuff to hunt down errors on Debian Perl 5.18.1 ia64/…
Browse files Browse the repository at this point in the history
…armhf
  • Loading branch information
Kartik Thakore authored and Kartik Thakore committed Sep 5, 2013
1 parent d4520c7 commit 3507b2d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/SDLx/Controller.pm
Expand Up @@ -11,6 +11,7 @@ use SDL::Video ();
use SDLx::Controller::Interface;
use SDLx::Controller::State;
use Scalar::Util 'refaddr';
use Data::Dumper;

our $VERSION = '2.541_10';
$VERSION = eval $VERSION;
Expand Down Expand Up @@ -162,6 +163,7 @@ sub _pause {
my $callback = $_paused{$ref};

do {

SDL::Events::pump_events(); # don't know if we need this
SDL::Events::wait_event($event) or Carp::confess("pause failed waiting for an event");
$stop_handler->( $event, $self ) if $stop_handler;
Expand Down Expand Up @@ -194,6 +196,9 @@ sub _event {
my $stop_handler = $_stop_handler{$ref};
my $event = $_event{$ref};

warn "Event loop runs";
warn SDL::get_error();

SDL::Events::pump_events();
while ( SDL::Events::poll_event($event) ) {
$stop_handler->( $event, $self ) if $stop_handler;
Expand Down
5 changes: 5 additions & 0 deletions t/sdlx_controller_interface.t
Expand Up @@ -82,8 +82,13 @@ my $eve = SDL::Event->new();

SDL::Events::push_event($eve);
my $counts = [ 0, 0, 0 ];

warn "Pushing event: " . SDL::get_error();

$controller->add_event_handler(
sub {
warn "Event pushed was processed";
warn Dumper \@_;
$counts->[0]++;
return 0;
}
Expand Down

0 comments on commit 3507b2d

Please sign in to comment.