Permalink
Browse files

Added Tony's Resize fix and update Contributors

  • Loading branch information...
1 parent e824428 commit fc9cc5fbccf25a26b77cba782c0f09f7c08897a7 @kthakore kthakore committed Jan 6, 2010
Showing with 20 additions and 2 deletions.
  1. +1 −0 CHANGELOG
  2. +4 −0 CONTRIBUTORS
  3. +2 −0 lib/SDL/App.pm
  4. +13 −2 t/apppm.t
View
@@ -6,6 +6,7 @@ Revision history for Perl extension SDL_perl.
- GFX rotozoom started [FROGGS]
- More docs for GFX [FROGGS]
- ithreads support for audio and timer callback [kthakore, ruoso]
+ - SDL::App resize fixed [kthakore, TonyC] {http://rt.cpan.org/Public/Bug/Display.html?id=16984}
* 2.3_3
- SDL::Image implemented and tested [#72] [kthakore]
View
@@ -2,6 +2,10 @@ Contributors
The following people have dedicated blood sweat and tears to making SDL Perl possible.
+Breno (garu)
+Tobias Leich
+James King
+Tony C
Daniel Ruoso http://daniel.ruoso.com/
kmx <kmx@cpan.org>
Kartik Thakore <thakore.kartik@gmail.com>
View
@@ -100,6 +100,8 @@ sub resize ($$$) {
if ( $flags & SDL_RESIZABLE) {
my $bpp = $self->format->BitsPerPixel;
$self = SDL::Video::set_video_mode($w,$h,$bpp,$flags) or die "SDL cannot set video:".SDL::get_error;
+ } else {
+ die "Application surface not resizable";
}
}
View
@@ -39,7 +39,7 @@ use Test::More;
use lib 't/lib';
use SDL::TestTool;
- plan( tests => 3 );
+ plan( tests => 8 );
use_ok( 'SDL::App' );
can_ok ('SDL::App', qw/
@@ -59,13 +59,24 @@ can_ok ('SDL::App', qw/
SKIP:
{
- skip 'Video not avaiable', 1 unless SDL::TestTool->init(SDL_INIT_VIDEO);
+ skip 'Video not avaiable', 6 unless SDL::TestTool->init(SDL_INIT_VIDEO);
my $app = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init => SDL_INIT_VIDEO);
$app->sync;
sleep(1);
pass 'App inited';
+ ok(!eval { $app->resize(640, 480); 1 }, "can't resize with no -resizeable");
+ like($@, qr/not resizable/, "check for error message");
+ SDL::quit;
+
+ my $app2 = SDL::App->new(-title => "Test", -width => 640, -height => 480, -init => SDL_INIT_VIDEO, -resizeable => 1);
+ $app2->sync;
+ ok(eval { $app2->resize(640, 480); 1 }, "succeed at resize");
+ ok(!eval { $app2->resize(-1, -1); 1 }, "fail to resize to bad size");
+ like($@, qr/cannot set video/, "check error message");
}
+
+
sleep(2);

0 comments on commit fc9cc5f

Please sign in to comment.