Commit | Line | Data |
df4106bf |
1 | #!/usr/bin/perl -w |
df4106bf |
2 | use strict; |
3 | use SDL; |
4510df28 |
4 | use SDL::Surface; |
df4106bf |
5 | use SDL::Config; |
7fa192d4 |
6 | use Devel::Peek; |
4510df28 |
7 | use Data::Dumper; |
df4106bf |
8 | use Test::More; |
eaf32d63 |
9 | use SDL::Rect; |
df4106bf |
10 | |
19f3ee7b |
11 | plan ( tests => 10 ); |
df4106bf |
12 | |
13 | use_ok( 'SDL::Video' ); |
14 | |
15 | can_ok ('SDL::Video', qw/ |
16 | get_video_surface |
17 | get_video_info |
8a2411d0 |
18 | video_driver_name |
7dda1934 |
19 | list_modes |
bbe5d2f5 |
20 | set_video_mode |
218b5471 |
21 | video_mode_ok |
eaf32d63 |
22 | update_rect |
23 | update_rects |
19f3ee7b |
24 | flip |
95f5be30 |
25 | /); |
26 | |
27 | #testing get_video_surface |
28 | SDL::Init(SDL_INIT_VIDEO); |
29 | |
30 | my $display = SDL::SetVideoMode(640,480,32, SDL_SWSURFACE ); |
31 | |
218b5471 |
32 | #diag('Testing SDL::Video'); |
95f5be30 |
33 | |
e4259ddb |
34 | isa_ok(SDL::Video::get_video_surface(), 'SDL::Surface', '[get_video_surface] Checking if we get a surface ref back'); |
35 | |
36 | isa_ok(SDL::Video::get_video_info(), 'SDL::VideoInfo', '[get_video_info] Checking if we get videoinfo ref back'); |
20f544ea |
37 | |
7fa192d4 |
38 | my $driver_name = SDL::Video::video_driver_name(); |
39 | |
e4259ddb |
40 | pass '[video_driver_name] This is your driver name: '.$driver_name; |
7fa192d4 |
41 | |
218b5471 |
42 | |
43 | |
44 | is( ref( SDL::Video::list_modes( $display->format , SDL_SWSURFACE )), 'ARRAY', '[list_modes] Returned an ARRAY! '); |
45 | |
46 | cmp_ok(SDL::Video::video_mode_ok( 100, 100, 16, SDL_SWSURFACE), '>=', 0, "[video_mode_ok] Checking if an integer was return"); |
7fa192d4 |
47 | |
bbe5d2f5 |
48 | isa_ok(SDL::Video::set_video_mode( 100, 100 ,16, SDL_SWSURFACE), 'SDL::Surface', '[set_video_more] Checking if we get a surface ref back'); |
49 | |
50 | |
51 | |
52 | #TODO: Write to surface and check inf pixel in that area got updated. |
53 | |
eaf32d63 |
54 | SDL::Video::update_rect($display, 0, 0, 0, 0); |
55 | |
bbe5d2f5 |
56 | #TODO: Write to surface and check inf pixel in that area got updated. |
eaf32d63 |
57 | SDL::Video::update_rects($display, SDL::Rect->new(0, 10, 20, 20)); |
58 | |
19f3ee7b |
59 | is( (SDL::Video::flip($display) == 0 || -1), 1, '[flip] returns 0 or -1' ); |
60 | |
bc1947c7 |
61 | pass "Are we still alive?"; |
62 | |
95f5be30 |
63 | =skip |
d817c64c |
64 | get_video_surface |
65 | get_video_info |
66 | video_driver_name |
67 | list_modes |
df4106bf |
68 | set_video_mode |
d817c64c |
69 | video_mode_ok |
df4106bf |
70 | update_rect |
71 | update_rects |
72 | flip |
73 | set_colors |
74 | set_palette |
75 | set_gamma |
76 | get_gamma_ramp |
77 | set_gmmma_ramp |
78 | map_RGB |
79 | map_RGBA |
80 | get_RGB |
81 | get_RGBA |
82 | create_RGB_surface_from |
83 | lock_surface |
84 | unlock_surface |
85 | convert_surface |
86 | display_format |
87 | display_format_alpha |
88 | load_BMP |
89 | save_BMP |
90 | set_color_key |
91 | set_alpha |
92 | set_clip_rect |
93 | get_clip_rect |
94 | blit_surface |
95 | fill_rect |
96 | GL_load_library |
97 | GL_get_proc_address |
98 | GL_get_attribute |
99 | GL_set_attribute |
100 | GL_swap_buffers |
101 | GL_attr |
df4106bf |
102 | lock_YUV_overlay |
103 | unlock_YUV_overlay |
104 | display_YUV_overlay |
df4106bf |
105 | /); |
106 | |