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