Added missing SDL_Palette XS bindings file.
[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
d817c64c 61 get_video_surface
62 get_video_info
63 video_driver_name
64 list_modes
df4106bf 65 set_video_mode
d817c64c 66 video_mode_ok
df4106bf 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
df4106bf 99 lock_YUV_overlay
100 unlock_YUV_overlay
101 display_YUV_overlay
df4106bf 102 /);
103