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