try seperating out surface - not quite working yet
[sdlgit/SDL_perl.git] / t / surfacepm.t
CommitLineData
88a46efc 1#!perl
8fde61e3 2use strict;
88a46efc 3use warnings;
4use Test::More tests => 11;
5use_ok('SDL');
6use_ok('SDL::Color');
7use_ok('SDL::Rect');
8use_ok('SDL::Surface');
9
10my $surface
11 = SDL::Surface->new( SDL::SDL_ANYFORMAT(), 640, 320, 0, 0, 0, 0, 0 );
12isa_ok( $surface, 'SDL::Surface' );
13is( $surface->w, 640, 'surface has width' );
14is( $surface->h, 320, 'surface has height' );
15
16my $image = SDL::Surface->load('test/data/logo.png');
17is( $image->w, 608, 'image has width' );
18is( $image->h, 126, 'image has height' );
19
20$surface->fill_rect( SDL::Rect->new( 0, 0, 32, 32 ),
21 SDL::Color->new( 200, 200, 200 ) );
22ok( 1, 'Managed to fill_rect' );
23
24my $rect = SDL::Rect->new( 0, 0, 64, 64 );
25$image->blit( $rect, $surface, $rect );
26ok( 1, 'Managed to blit' );
27
28#my $image_format = $surface->display;
29#$surface->update_rect( 0, 0, 32, 32 );
30#ok( 1, 'Managed to update_rect' );
31#$surface->update_rects( SDL::Rect->new( 0, 0, 32, 32 ) );
32#ok( 1, 'Managed to update_rects' );
8fde61e3 33