Added set_video_mode at test
[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;
eaf32d63 9use SDL::Rect;
df4106bf 10
bbe5d2f5 11plan ( tests => 9 );
df4106bf 12
13use_ok( 'SDL::Video' );
14
15can_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
95f5be30 24 /);
25
26#testing get_video_surface
27SDL::Init(SDL_INIT_VIDEO);
28
29my $display = SDL::SetVideoMode(640,480,32, SDL_SWSURFACE );
30
218b5471 31#diag('Testing SDL::Video');
95f5be30 32
e4259ddb 33isa_ok(SDL::Video::get_video_surface(), 'SDL::Surface', '[get_video_surface] Checking if we get a surface ref back');
34
35isa_ok(SDL::Video::get_video_info(), 'SDL::VideoInfo', '[get_video_info] Checking if we get videoinfo ref back');
20f544ea 36
7fa192d4 37my $driver_name = SDL::Video::video_driver_name();
38
e4259ddb 39pass '[video_driver_name] This is your driver name: '.$driver_name;
7fa192d4 40
218b5471 41
42
43is( ref( SDL::Video::list_modes( $display->format , SDL_SWSURFACE )), 'ARRAY', '[list_modes] Returned an ARRAY! ');
44
45cmp_ok(SDL::Video::video_mode_ok( 100, 100, 16, SDL_SWSURFACE), '>=', 0, "[video_mode_ok] Checking if an integer was return");
7fa192d4 46
bbe5d2f5 47isa_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
eaf32d63 53SDL::Video::update_rect($display, 0, 0, 0, 0);
54
bbe5d2f5 55#TODO: Write to surface and check inf pixel in that area got updated.
eaf32d63 56SDL::Video::update_rects($display, SDL::Rect->new(0, 10, 20, 20));
57
bc1947c7 58pass "Are we still alive?";
59
95f5be30 60=skip
df4106bf 61 video_mode_ok
62 set_video_mode
63 update_rect
64 update_rects
65 flip
66 set_colors
67 set_palette
68 set_gamma
69 get_gamma_ramp
70 set_gmmma_ramp
71 map_RGB
72 map_RGBA
73 get_RGB
74 get_RGBA
75 create_RGB_surface_from
76 lock_surface
77 unlock_surface
78 convert_surface
79 display_format
80 display_format_alpha
81 load_BMP
82 save_BMP
83 set_color_key
84 set_alpha
85 set_clip_rect
86 get_clip_rect
87 blit_surface
88 fill_rect
89 GL_load_library
90 GL_get_proc_address
91 GL_get_attribute
92 GL_set_attribute
93 GL_swap_buffers
94 GL_attr
df4106bf 95 lock_YUV_overlay
96 unlock_YUV_overlay
97 display_YUV_overlay
df4106bf 98 /);
99