Permalink
Browse files

Merged experimental into master

  • Loading branch information...
Kartik Thakore
Kartik Thakore committed May 16, 2012
2 parents 7e80853 + c13693c commit 3512b1b6790a2e6beea76316aba8583ec45c7fc2
Showing with 2,051 additions and 854 deletions.
  1. +1 −1 Build.PL
  2. +31 −0 CHANGELOG
  3. +0 −8 examples/SDLx/SDLx_C_Interface.pl
  4. +0 −1 examples/SDLx/SDLx_Sound.pl
  5. +0 −2 examples/SDLx/SDLx_controller_two_squares.pl
  6. +1 −1 examples/SDLx/SDLx_text.pl
  7. +1 −1 examples/SDLx/SDLx_text_shadow.pl
  8. +1 −1 examples/SDLx/SDLx_text_styles.pl
  9. +1 −1 examples/SDLx/SDLx_text_wordwrap.pl
  10. +1 −1 examples/SDLx/SDLx_text_zoom.pl
  11. +4 −8 examples/SDLx/app.pl
  12. +1 −1 examples/SDLx/music.pl
  13. +1 −3 examples/SDLx/pong.pl
  14. +1 −1 lib/SDL.pm
  15. +5 −2 lib/SDL/Constants.pm
  16. +2 −1 lib/SDL/Event.pm
  17. +2 −1 lib/SDL/Events.pm
  18. +2 −0 lib/SDL/GFX/ImageFilter.pm
  19. +13 −0 lib/SDL/Version.pm
  20. +299 −165 lib/SDLx/App.pm
  21. +185 −117 lib/SDLx/Controller.pm
  22. +48 −7 lib/SDLx/Surface.pm
  23. +30 −0 lib/pods/SDL/Deprecated.pod
  24. +56 −51 lib/pods/SDL/Events.pod
  25. +117 −0 lib/pods/SDL/Platform.pod
  26. +6 −0 lib/pods/SDL/Surface.pod
  27. +367 −105 lib/pods/SDLx/App.pod
  28. +382 −130 lib/pods/SDLx/Controller.pod
  29. +5 −5 src/Mixer/Channels.xs
  30. +107 −125 src/SDLx/Controller/Interface.xs
  31. +4 −0 t/core_cd.t
  32. +2 −3 t/gfx_imagefilter.t
  33. +1 −2 t/gfx_primitives.t
  34. +2 −4 t/gfx_primitives2.t
  35. +3 −6 t/gfx_rotozoom.t
  36. +1 −2 t/image.t
  37. +2 −4 t/mixer.t
  38. +16 −5 t/mixer_channels.t
  39. +27 −25 t/mixer_music.t
  40. +2 −5 t/mixer_samples.t
  41. +9 −5 t/sdlx_app.t
  42. +288 −29 t/sdlx_controller.t
  43. +20 −15 t/sdlx_controller_interface.t
  44. +1 −1 t/sdlx_fps.t
  45. +2 −2 t/sdlx_surface.t
  46. +1 −7 t/ttf.t
  47. BIN test/data/sample.ogg
  48. BIN test/data/silence.ogg
View
@@ -606,7 +606,7 @@ my $build = $package->new(
#create_readme => 1, ### make sense only if there is some POD doc in the file specified by dist_version_from
meta_merge => {
resources => {
- bugtracker => 'http://sdlperl.ath.cx/projects/SDLPerl',
+ bugtracker => 'http://github.com/PerlGameDev/SDL/issues',
repository => 'http://github.com/PerlGameDev/SDL'
}
},
View
@@ -2,6 +2,37 @@ 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
+ - 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]
+ - SDLx::App updated methods resize, title, icon, error, show_cursor, grab_input [Blaizer]
+ - SDLx::App fullscreen method works better [Blaizer]
+ - SDLx::App new init method does our initializing right [Blaizer]
+ - SDLx::App new set_video_mode method does set_video_mode for SDLx::App [Blaizer]
+ - SDLx::App new screen_size method returns the user's screen size [Blaizer]
+ - SDLx::App warp method renamed to warp_cursor, attribute renamed to gl_attribute [Blaizer]
+ - SDLx::App fix to return the user's resolution to normal when a fullscreen app closes [FROGGS]
+ - SDLx::App removed delay method and deprecated get_ticks [Blaizer]
+ - SDLx::Controller removed eoq, its action is on by default and implemented by stop_handler [Blaizer]
+ - SDLx::Controller made the docs a lot better, even proofread them [Blaizer]
+ - SDLx::Controller pause works by stopping the app [Blaizer]
+ - SDLx::Controller added stopped and paused methods to tell what the app is doing [Blaizer]
+ - SDLx::Controller added max_t param, by default slows down apps going at less than 10 FPS [Blaizer]
+ - 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]
+ - SDL::Mixer::Channels: skipping callback test [FROGGS]
+ - SDL::Version: we can now compare SDL::Version objects like: $version >= 1.2.10 [FROGGS]
+ - SDLx::App::DESTROY: fixed function name for set_video_mode [FROGGS]
+ - SDLx::App: fix for issue 144, setting original screen res when app ends [FROGGS]
+ - t/sdlx_controller_interface.t: adding delay so that slow machines doesnt get a hickup [FROGGS]
+
* 2.536 Jan 04 2011
- using INT2PTR to convert stored pointers to right size and hide warnings [FROGGS]
- SDL::Mixer::Channels: using malloc instead of safemalloc [FROGGS]
@@ -34,14 +34,6 @@
$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 ) } );
@@ -44,7 +44,6 @@
# 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";
@@ -101,8 +101,6 @@ 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;
}
}
@@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;
-my $app = SDLx::App->new( eoq => 1 );
+my $app = SDLx::App->new();
my $text = SDLx::Text->new;
@@ -7,7 +7,7 @@
use SDLx::App;
use SDLx::Text;
-my $app = SDLx::App->new( eoq => 1 );
+my $app = SDLx::App->new();
my $normal = SDLx::Text->new;
my $shadow = SDLx::Text->new( shadow => 1 );
@@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;
-my $app = SDLx::App->new( eoq => 1 );
+my $app = SDLx::App->new();
my $text = SDLx::Text->new;
@@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;
-my $app = SDLx::App->new( eoq => 1 );
+my $app = SDLx::App->new();
my $text = SDLx::Text->new( word_wrap => 450 );
@@ -7,7 +7,7 @@
use SDLx::App;
use SDLx::Text;
-my $app = SDLx::App->new( eoq => 1, width => 400, height => 100 );
+my $app = SDLx::App->new( width => 400, height => 100 );
my $text = SDLx::Text->new;
View
@@ -7,15 +7,11 @@
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();
-
-
View
@@ -4,4 +4,4 @@
$music->data( sam => "test/data/sample.wav" );
$sam = $music->data("sam");
$music->play($sam);
-while ( $music->playing ) { print "playing\n" }
+while ( $music->playing ) { print "playing\n"; sleep 1; }
View
@@ -29,7 +29,7 @@
y => 0,
w => 20,
h => 80,
- vel => 250,
+ vel => 130,
y_vel => 0,
};
@@ -143,8 +143,6 @@ 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;
}
}
View
@@ -54,7 +54,7 @@ our %EXPORT_TAGS = (
defaults => $SDL::Constants::EXPORT_TAGS{'SDL/defaults'}
);
-our $VERSION = '2.536';
+our $VERSION = '2.537_02';
$VERSION = eval $VERSION;
print "$VERSION" if ( defined( $ARGV[0] ) && ( $ARGV[0] eq '--SDLperl' ) );
View
@@ -1030,6 +1030,11 @@ 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,
@@ -1217,8 +1222,6 @@ 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 {
View
@@ -24,7 +24,8 @@ 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'}
+ keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'},
+ repeat => $SDL::Constants::EXPORT_TAGS{'SDL::Events/repeat'}
);
1;
View
@@ -24,7 +24,8 @@ 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'}
+ keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'},
+ repeat => $SDL::Constants::EXPORT_TAGS{'SDL::Events/repeat'}
);
1;
@@ -19,4 +19,6 @@ our %EXPORT_TAGS = (
smoothing => $SDL::Constants::EXPORT_TAGS{'SDL::GFX/smoothing'}
);
+MMX_on();
+
1;
View
@@ -8,6 +8,19 @@ our @ISA = qw(Exporter DynaLoader);
use SDL::Internal::Loader;
internal_load_dlls(__PACKAGE__);
+use overload '<=>' => \&my_cmp,
+ '""' => \&stringify;
+
bootstrap SDL::Version;
+sub stringify {
+ my $self = shift;
+ return sprintf "%s%s%s", chr($self->major), chr($self->minor), chr($self->patch);
+}
+
+sub my_cmp {
+ my ($left, $right) = @_;
+ return "$left" cmp "$right";
+}
+
1;
Oops, something went wrong.

0 comments on commit 3512b1b

Please sign in to comment.