Permalink
Browse files

Merging SDLx::App with a few fixes to its docs

  • Loading branch information...
2 parents b84b9b3 + 20175d1 commit a675d5719b8c782f5d595f6ecb22ebfa5ad8401d @Blaizer Blaizer committed Mar 31, 2012
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,9 +2,15 @@ Revision history for Perl extension SDL_perl.
Versioning rule: public releases are even numbers, dev releases are odd. (same like perl dist)
-* 2.537_01 Jan 22 2012
- - t/core_cd.t: gnu hurd 0.3 handles devices like cdrom strange [FROGGS]
+* 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]
View
@@ -54,7 +54,7 @@ our %EXPORT_TAGS = (
defaults => $SDL::Constants::EXPORT_TAGS{'SDL/defaults'}
);
-our $VERSION = '2.537_01';
+our $VERSION = '2.537_02';
$VERSION = eval $VERSION;
print "$VERSION" if ( defined( $ARGV[0] ) && ( $ARGV[0] eq '--SDLperl' ) );
View
@@ -1031,6 +1031,11 @@ use constant {
}; # 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,
}; # SDL::GFX/smoothing
@@ -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;
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;
View
@@ -88,9 +88,11 @@ sub new {
# keep the screen's original res so we can set the app to that when we're done
unless(defined $_screen_w && defined $_screen_h && defined $_screen_d) {
my $video_info = SDL::Video::get_video_info();
- $_screen_w = $video_info->current_w;
- $_screen_h = $video_info->current_h;
- $_screen_d = $video_info->vfmt->BitsPerPixel;
+ if($video_info) {
+ $_screen_w = $video_info->current_w;
+ $_screen_h = $video_info->current_h;
+ $_screen_d = $video_info->vfmt->BitsPerPixel;
+ }
}
$f |= SDL::Video::SDL_SWSURFACE if $sw;
@@ -150,7 +152,7 @@ sub new {
SDL::Video::GL_set_attribute( SDL::Video::SDL_GL_SWAP_CONTROL, $sc ) if defined $sc;
SDL::Video::GL_set_attribute( SDL::Video::SDL_GL_ACCELERATED_VISUAL, $av ) if defined $av;
}
-
+
# icon must be set before set_video_mode
SDLx::App->icon( $ico, $icc ) if defined $ico;
@@ -191,7 +193,7 @@ sub DESTROY {
my ( $self ) = @_;
# set original screen size when app ends
- if($_screen_w && $_screen_h && $_screen_d) {
+ if(defined $_screen_w && defined $_screen_h && defined $_screen_d) {
SDL::Video::set_video_mode( $_screen_w, $_screen_h, $_screen_d, $self->flags );
}
Oops, something went wrong.

0 comments on commit a675d57

Please sign in to comment.