Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:PerlGameDev/SDL into sdlx_screen
  • Loading branch information
FROGGS committed May 18, 2014
2 parents a4881ab + ba434d5 commit 881c69d
Show file tree
Hide file tree
Showing 76 changed files with 1,257 additions and 2,215 deletions.
31 changes: 31 additions & 0 deletions .travis.yml
@@ -0,0 +1,31 @@
language: perl
perl:
- "5.8"
- "5.10"
- "5.12"
- "5.14"
- "5.16"
- "5.18"

before_install:
# install Alien:SDL
- sudo apt-get install automake
- git clone https://github.com/PerlGameDev/Alien-SDL
- cd Alien-SDL
- cat ./cpan-deps | cpanm --sudo --notest
- perl ./Build.PL --travis
- sudo ./Build install
- prove -v
- cd ..
# success!!

# install SDL_Perl
install:
- cpanm --sudo --notest Test::Most Tie::Simple
- perl ./Build.PL
- sudo ./Build install

script: prove -v

notifications:
irc: irc.perl.org#sdl
4 changes: 2 additions & 2 deletions Build.PL
Expand Up @@ -588,7 +588,7 @@ my $build = $package->new(
dist_version_from => 'lib/SDL.pm',
configure_requires => {
'ExtUtils::CBuilder' => '0.260301',
'Alien::SDL' => '1.426',
'Alien::SDL' => '1.444',
'File::Find' => '0',
'File::ShareDir' => '1.0',
'Tie::Simple' => '0',
Expand All @@ -598,7 +598,7 @@ my $build = $package->new(
'Test::Simple' => '0.88',
'Capture::Tiny' => '0',
'Test::Most' => '0.21',
'Alien::SDL' => '1.426',
'Alien::SDL' => '1.444',
'File::Find' => '0',
'File::ShareDir' => '1.0',
'Tie::Simple' => '0',
Expand Down
15 changes: 12 additions & 3 deletions CHANGELOG
Expand Up @@ -2,7 +2,18 @@ Revision history for Perl extension SDL_perl.

Versioning rule: public releases are even numbers, dev releases are odd. (same like perl dist)

* 2.537_03 Apr 12 2012
* 2.544 May 14 2014
- Updated Alien::SDL's version we depend on to get an OpenBSD/pthread fix [FROGGS]
- Fix segfault in cleanup of MixChunks on windows [FROGGS]
- Adjusting test for SDL_gfx >= 2.0.24 [FROGGS]

* 2.540 May 26 2012
- Removed all non-pod changes introduced in 2.538 [jtpalmer]
- Fixed bugtracker link [FROGGS]
- Added SDL::Platform pod [pktm]

* 2.538 May 22 2012
- Pod updates [mig0]
- SDLx::App made the docs a lot better [Blaizer]
- SDLx::App changed around shortcut names in the constructor [Blaizer]
- SDLx::App added and improved parameters of the constructor, see docs [Blaizer]
Expand All @@ -22,8 +33,6 @@ Versioning rule: public releases are even numbers, dev releases are odd. (same l
- SDLx::Controller added time and sleep methods to replace get_ticks and delay [Blaizer]
- SDLx::Controller added some tests for pausing and events [Blaizer]
- SDLx::Controller removed current_time parameter [Blaizer]

* 2.537_02 Feb 13 2012
- t/core_cd.t: gnu hurd 0.3 handles devices like cdrom strange (skipping tests) [FROGGS]
- t/sdlx_fps.t: seems better to try to get 5 fps (slow vm's) [FROGGS]
- SDLx::Controller::Interface: weaken tests [FROGGS]
Expand Down
622 changes: 262 additions & 360 deletions COPYING

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions examples/SDLx/SDLx_C_Interface.pl
Expand Up @@ -34,6 +34,14 @@
$app->draw_rect( [ 100 - $state->x, $state->y, 2, 2 ], 0xFF0FFF );
};

#an event handler to exit
my $event = sub {
$_[1]->stop if $_[0]->type == SDL_QUIT;
};


$app->add_event_handler($event);

#clear the screen
$app->add_show_handler( sub { $app->draw_rect( [ 0, 0, $app->w, $app->h ], 0x000000 ) } );

Expand Down
1 change: 1 addition & 0 deletions examples/SDLx/SDLx_Sound.pl
Expand Up @@ -44,6 +44,7 @@
# pause or resume on keydown
$app->add_event_handler( sub{
my $e = $_[0];
$_[1]->stop() if $e->type == SDL_QUIT;
if( $e->type == SDL_KEYDOWN )
{
print "Ai\n";
Expand Down
2 changes: 2 additions & 0 deletions examples/SDLx/SDLx_controller_two_squares.pl
Expand Up @@ -101,6 +101,8 @@ sub on_event {
$ball->{x_vel} += $ball->{vel} if $key == SDLK_LEFT;
$ball->{x_vel} -= $ball->{vel} if $key == SDLK_RIGHT;

} elsif ( $event->type == SDL_QUIT ) {
$_[0]->stop;
}

}
Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text.pl
Expand Up @@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new();
my $app = SDLx::App->new( eoq => 1 );

my $text = SDLx::Text->new;

Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_shadow.pl
Expand Up @@ -7,7 +7,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new();
my $app = SDLx::App->new( eoq => 1 );

my $normal = SDLx::Text->new;
my $shadow = SDLx::Text->new( shadow => 1 );
Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_styles.pl
Expand Up @@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new();
my $app = SDLx::App->new( eoq => 1 );

my $text = SDLx::Text->new;

Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_wordwrap.pl
Expand Up @@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new();
my $app = SDLx::App->new( eoq => 1 );

my $text = SDLx::Text->new( word_wrap => 450 );

Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_zoom.pl
Expand Up @@ -7,7 +7,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new( width => 400, height => 100 );
my $app = SDLx::App->new( eoq => 1, width => 400, height => 100 );

my $text = SDLx::Text->new;

Expand Down
12 changes: 8 additions & 4 deletions examples/SDLx/app.pl
Expand Up @@ -7,11 +7,15 @@
height => 480,
);

sub draw_lines {
$app->draw_line( [ rand $app->w, rand $app->h ], [ rand $app->w, rand $app->h ], 0xFFFFFFFF );
$app->update();
}


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


2 changes: 1 addition & 1 deletion examples/SDLx/music.pl
Expand Up @@ -4,4 +4,4 @@
$music->data( sam => "test/data/sample.wav" );
$sam = $music->data("sam");
$music->play($sam);
while ( $music->playing ) { print "playing\n"; sleep 1; }
while ( $music->playing ) { print "playing\n" }
4 changes: 3 additions & 1 deletion examples/SDLx/pong.pl
Expand Up @@ -29,7 +29,7 @@
y => 0,
w => 20,
h => 80,
vel => 130,
vel => 250,
y_vel => 0,
};

Expand Down Expand Up @@ -143,6 +143,8 @@ sub on_event {
my $key = $event->key_sym;
$paddle->{y_vel} += $paddle->{vel} if $key == SDLK_UP;
$paddle->{y_vel} -= $paddle->{vel} if $key == SDLK_DOWN;
} elsif ( $event->type == SDL_QUIT ) {
exit;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/SDL.pm
Expand Up @@ -54,7 +54,7 @@ our %EXPORT_TAGS = (
defaults => $SDL::Constants::EXPORT_TAGS{'SDL/defaults'}
);

our $VERSION = '2.537_02';
our $VERSION = '2.544';
$VERSION = eval $VERSION;

print "$VERSION" if ( defined( $ARGV[0] ) && ( $ARGV[0] eq '--SDLperl' ) );
Expand Down
7 changes: 2 additions & 5 deletions lib/SDL/Constants.pm
Expand Up @@ -1030,11 +1030,6 @@ use constant {
KMOD_META => ( KMOD_LMETA | KMOD_RMETA ),
}; # SDL::Events/keymod
use constant {
SDL_DEFAULT_REPEAT_DELAY => 500,
SDL_DEFAULT_REPEAT_INTERVAL => 30,
}; # SDL::Events/repeat
use constant {
SMOOTHING_OFF => 0,
SMOOTHING_ON => 1,
Expand Down Expand Up @@ -1222,6 +1217,8 @@ use constant {
FPS_LOWER_LIMIT => 1,
FPS_DEFAULT => 30,
SDL_ALL_HOTKEYS => 0xFFFFFFFF,
SDL_DEFAULT_REPEAT_DELAY => 500,
SDL_DEFAULT_REPEAT_INTERVAL => 30,
};
use constant {
Expand Down
3 changes: 1 addition & 2 deletions lib/SDL/Event.pm
Expand Up @@ -24,8 +24,7 @@ our %EXPORT_TAGS = (
app => $SDL::Constants::EXPORT_TAGS{'SDL::Events/app'},
button => $SDL::Constants::EXPORT_TAGS{'SDL::Events/button'},
keysym => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keysym'},
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'},
repeat => $SDL::Constants::EXPORT_TAGS{'SDL::Events/repeat'}
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'}
);

1;
3 changes: 1 addition & 2 deletions lib/SDL/Events.pm
Expand Up @@ -24,8 +24,7 @@ our %EXPORT_TAGS = (
app => $SDL::Constants::EXPORT_TAGS{'SDL::Events/app'},
button => $SDL::Constants::EXPORT_TAGS{'SDL::Events/button'},
keysym => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keysym'},
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'},
repeat => $SDL::Constants::EXPORT_TAGS{'SDL::Events/repeat'}
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'}
);

1;
2 changes: 0 additions & 2 deletions lib/SDL/GFX/ImageFilter.pm
Expand Up @@ -19,6 +19,4 @@ our %EXPORT_TAGS = (
smoothing => $SDL::Constants::EXPORT_TAGS{'SDL::GFX/smoothing'}
);

MMX_on();

1;

0 comments on commit 881c69d

Please sign in to comment.