PageRenderTime 52ms CodeModel.GetById 33ms app.highlight 14ms RepoModel.GetById 1ms app.codeStats 0ms

/t/core_overlay.t

http://github.com/PerlGameDev/SDL
Perl | 35 lines | 25 code | 9 blank | 1 comment | 4 complexity | 0e0b29e241f6a3176b120c46c9c2e0c0 MD5 | raw file
 1#!perl
 2use strict;
 3use warnings;
 4use Test::More;
 5use SDL;
 6use SDL::Surface;
 7use SDL::Video;
 8
 9use lib 't/lib';
10use SDL::TestTool;
11
12my $videodriver = $ENV{SDL_VIDEODRIVER};
13$ENV{SDL_VIDEODRIVER} = 'dummy' unless $ENV{SDL_RELEASE_TESTING};
14
15if ( !SDL::TestTool->init(SDL_INIT_VIDEO) ) {
16	plan( skip_all => 'Failed to init video' );
17} else {
18	plan( tests => 2 );
19}
20
21use_ok('SDL::Overlay');
22
23my $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_ANYFORMAT );
24
25my $overlay = SDL::Overlay->new( 100, 100, SDL_YV12_OVERLAY, $display );
26
27isa_ok( $overlay, 'SDL::Overlay' );
28
29if ($videodriver) {
30	$ENV{SDL_VIDEODRIVER} = $videodriver;
31} else {
32	delete $ENV{SDL_VIDEODRIVER};
33}
34
35sleep(2);