- Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathtestgraphictool.pl
65 lines (53 loc) · 1.23 KB
/
testgraphictool.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env perl
use strict;
use warnings;
use SDL;
use SDL::Surface;
use SDLx::App;
use SDL::Tool::Graphic;
my$app = SDLx::App->new(
-title=>"Graphic Tool Test",
-width=> 640,
-height=> 480,
-depth=> 16,
-fullscreen=> 0
);
my$app_rect = SDL::Rect->new(
-x=> 0,
-y=> 0,
-width=>$app->width,
-height=>$app->height
);
my$sprite = SDL::Surface->new( -name=>"data/logo.png" );
$sprite->display_format();
#Test Zoom
my$graphicTool = SDL::Tool::Graphic->new();
$graphicTool->zoom( $sprite, .5, .5, 1 );
my$sprite_rect = SDL::Rect->new(
-x=> 0,
-y=> 0,
-width=>$sprite->width,
-height=>$sprite->height
);
$sprite->blit( $sprite_rect, $app, $sprite_rect );
$app->flip();
sleep 4;
$app->fill( $app_rect, $SDL::Color::black );
#Test Rotate
$graphicTool->rotoZoom( $sprite, 90, 1, 1 );
$sprite_rect = SDL::Rect->new(
-x=> 0,
-y=> 0,
-width=>$sprite->width,
-height=>$sprite->height
);
$sprite->blit( $sprite_rect, $app, $sprite_rect );
$app->flip();
sleep 4;
+print"GrayScaling\n";
+$app->fill( $app_rect, $SDL::Color::black );
#Test GrayScale
$graphicTool->grayScale($sprite);
$sprite->blit( $sprite_rect, $app, $sprite_rect );
$app->flip();
sleep 4;