SDL/SDLMain.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 29 CC 2 SCAR 12.8
CC
2
Cov
0%
new
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.6
1 use SDL::Video;
2 use SDL::Surface;
3 use SDL::Rect;
4  
5 ### The SDL startup routine class to have a screen video surface :
6 ### (also from sdl.perl.org)
7  
8 sub new {
9  
10 ($class, $screen_width, $screen_height) = @_;
11  
12 if (not defined($screen_width) and not defined($screen_height)) {
13 print "SDLMain : please provide a screen width and height\n";
14 exit(0);
15 }
16  
17 SDL::init(SDL_INIT_VIDEO);
18  
19 # setting video mode
20 my $screen_surface = SDL::Video::set_video_mode($screen_width,
21 $screen_height,
22 32,
23 SDL_ANYFORMAT);
24 $self = { screen_surface => $screen_surface, };
25  
26 bless $self, $class;
27 }
28  
29 1;