94b6dce5fdf45064a194c2bfab800c7715d71c56
[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 => 8 );
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         video_mode_ok
21         update_rect
22         update_rects
23         /);
24
25 #testing get_video_surface
26 SDL::Init(SDL_INIT_VIDEO);                                                                          
27                                                                                                     
28 my $display = SDL::SetVideoMode(640,480,32, SDL_SWSURFACE );
29
30 #diag('Testing SDL::Video');
31
32 isa_ok(SDL::Video::get_video_surface(), 'SDL::Surface', '[get_video_surface] Checking if we get a surface ref back'); 
33
34 isa_ok(SDL::Video::get_video_info(), 'SDL::VideoInfo', '[get_video_info] Checking if we get videoinfo ref back');
35
36 my $driver_name = SDL::Video::video_driver_name();
37
38 pass '[video_driver_name] This is your driver name: '.$driver_name;
39
40
41
42 is( ref( SDL::Video::list_modes( $display->format , SDL_SWSURFACE )), 'ARRAY', '[list_modes] Returned an ARRAY! ');
43
44 cmp_ok(SDL::Video::video_mode_ok( 100, 100, 16, SDL_SWSURFACE), '>=', 0, "[video_mode_ok] Checking if an integer was return");
45
46 SDL::Video::update_rect($display, 0, 0, 0, 0);
47
48 SDL::Video::update_rects($display, SDL::Rect->new(0, 10, 20, 20));
49
50 pass "Are we still alive?";
51
52 =skip
53         video_mode_ok
54         set_video_mode
55         update_rect
56         update_rects
57         flip
58         set_colors
59         set_palette
60         set_gamma
61         get_gamma_ramp
62         set_gmmma_ramp
63         map_RGB
64         map_RGBA
65         get_RGB
66         get_RGBA
67         create_RGB_surface_from
68         lock_surface
69         unlock_surface
70         convert_surface
71         display_format
72         display_format_alpha
73         load_BMP
74         save_BMP
75         set_color_key
76         set_alpha
77         set_clip_rect
78         get_clip_rect
79         blit_surface
80         fill_rect
81         GL_load_library
82         GL_get_proc_address
83         GL_get_attribute
84         GL_set_attribute
85         GL_swap_buffers
86         GL_attr
87         lock_YUV_overlay
88         unlock_YUV_overlay
89         display_YUV_overlay
90         /);
91