Skip to content

Commit fc8e50f

Browse files
committed
New texture passes
1 parent b430abb commit fc8e50f

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

t/106_sdl2_texture.t

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
use strict;
2-
use warnings;
3-
use Test::More;
4-
use SDL2::ConfigData;
1+
2+
use SDL2::Window;
3+
use SDL2::Renderer;
4+
use SDL2::Rect;
5+
use SDL2::Texture;
56

67
BEGIN {
8+
use SDL2::ConfigData;
9+
710
plan skip_all => 'SDL2::Texture not available' unless SDL2::ConfigData->config('mod2lib')->{'SDL2::Texture'};
8-
}
911

10-
use SDL2::Texture;
12+
}
1113

1214
ok( exists &SDL2::Texture::new, 'new exists');
1315

16+
exit 0 if SDL2pp::init(SDL_INIT_VIDEO) < 0 ; #SDL_INIT_VIDEO
17+
18+
my $win = SDL2::Window->new("FIRST WINDOW", 50, 50, 200, 200, SDL_WINDOW_SHOWN );
19+
20+
my $renderer = SDL2::Renderer->new($win, -1, SDL_RENDERER_SOFTWARE); #Hardware accelerated with software fallback
21+
22+
1423
can_ok('SDL2::Texture', qw/new/);
1524

25+
my $texture = SDL2::Texture->new($renderer, 1, 1, 100, 100);
26+
1627
done_testing();

0 commit comments

Comments
 (0)