cleaned up MANIFEST, Added it to .gitignore. Added lib/SDL/Video.pm with some prelim...
Kartik Thakore [Fri, 23 Oct 2009 15:49:43 +0000 (11:49 -0400)]
.gitignore
Build.PL
MANIFEST [deleted file]
MANIFEST.SKIP
lib/SDL/Video.pm [new file with mode: 0644]
src/Core/Video.xs
t/core_video.t

index df98469..72a84f6 100644 (file)
@@ -8,4 +8,6 @@ lib/SDL/*.xs
 SDL_perl.c
 SDL_perl.xs
 stage
+MANIFEST
+!MANIFEST.skip
 META.yml
index d97b7d2..f297f5a 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -42,6 +42,13 @@ my %subsystems =
                libraries => [qw( SDL SDL_image SDL_mixer SDL_net SDL_ttf SDL_gfx
                                  png jpeg smpeg )],
        },
+       Video => {
+               file      => {
+                       from  => 'src/Core/Video.xs',
+                       to    => 'lib/SDL/Video.xs',
+               },
+               libraries => [qw( SDL )],
+       },
        Rect => {
                file      => {
                        from  => 'src/Core/objects/Rect.xs',
diff --git a/MANIFEST b/MANIFEST
deleted file mode 100644 (file)
index 1ff704b..0000000
--- a/MANIFEST
+++ /dev/null
@@ -1,176 +0,0 @@
-BUGS
-CHANGELOG
-CONTRIBUTORS
-COPYING
-lib/SDL.pm
-lib/SDL/App.pm
-lib/SDL/Cdrom.pm
-lib/SDL/Color.pm
-lib/SDL/Config.pm
-lib/SDL/Constants.pm
-lib/SDL/Cursor.pm
-lib/SDL/Event.pm
-lib/SDL/Font.pm
-lib/SDL/Game/Rect.pm
-lib/SDL/Mixer.pm
-lib/SDL/MPEG.pm
-lib/SDL/Music.pm
-lib/SDL/OpenGL.pm
-lib/SDL/OpenGL/Constants.pm
-lib/SDL/Palette.pm
-lib/SDL/PixelFormat.pm
-lib/SDL/Rect.pm
-lib/SDL/SFont.pm
-lib/SDL/Sound.pm
-lib/SDL/Surface.pm
-lib/SDL/Timer.pm
-lib/SDL/Tool/Font.pm
-lib/SDL/Tool/Graphic.pm
-lib/SDL/TTF_Font.pm
-lib/SDL/TTFont.pm
-lib/SDL/Tutorial.pm
-lib/SDL/Tutorial/Animation.pm
-lib/SDL/Tutorial/Drawing.pm
-lib/SDL/Tutorial/Images.pm
-lib/SDL/Tutorial/LunarLander.pm
-lib/SDL/Tutorial/Pong.pm
-lib/SDL/Video.pm
-lib/SDL_perl.pm
-logo/sdl_perl_logo_large.png
-logo/sdl_perl_logo_small.png
-MacOSX/Info.plist
-MacOSX/launcher.h
-MacOSX/launcher.m
-MacOSX/SDLPerl.icns
-make/lib/SDL/Utility.pm
-MANIFEST                       This list of files
-MANIFEST.bak
-MANIFEST.SKIP
-META.yml
-README
-scripts/const.pl
-scripts/gl_const.pl
-scripts/OpenGL/Constants.pm
-scripts/opengl_words.txt
-scripts/README
-scripts/SDL/Constants.pm
-scripts/sdl_const.pl
-scripts/sdl_words.txt
-src/Core/Audio.xs
-src/Core/CDROM.xs
-src/Core/Events.xs
-src/Core/Files.xs
-src/Core/Joystick.xs
-src/Core/Mouse.xs
-src/Core/MultiThread.xs
-src/Core/objects/Color.xs
-src/Core/objects/PixelFormat.xs
-src/Core/objects/Rect.xs
-src/Core/objects/Surface.xs
-src/Core/SDL.xs
-src/Core/Time.xs
-src/Core/Video.xs
-src/Core/WindowMangement.xs
-src/defines.h
-src/Mixer/Channels.xs
-src/Mixer/Effects.xs
-src/Mixer/Groups.xs
-src/Mixer/Mixer.xs
-src/Mixer/Music.xs
-src/Mixer/objects/chunk.xs
-src/Mixer/objects/effectDone.xs
-src/Mixer/objects/effectFunc.xs
-src/Mixer/objects/fading.xs
-src/Mixer/objects/music.xs
-src/Mixer/objects/musicType.xs
-src/Mixer/README
-src/Mixer/Samples.xs
-src/OpenGL.xs
-src/SDL.xs
-src/SFont.h
-src/SFont.xs
-src/support/darwin_support.h
-src/support/darwin_support.m
-src/support/win32.c
-src/TTF/Attributes.xs
-src/TTF/Management.xs
-src/TTF/objects/TTF_Font.xs
-src/TTF/README
-src/TTF/Render.xs
-src/TTF/TTF.xs
-t/apppm.t
-t/cdrompm.t
-t/colorpm.t
-t/constantspm.t
-t/core_rect.t
-t/core_surface.t
-t/core_ttf.t
-t/cursorpm.t
-t/eventpm.t
-t/extendingrect.t
-t/fontpm.t
-t/intergation1.t
-t/manifest.t
-t/mixerpm.t
-t/mpegpm.t
-t/musicpm.t
-t/opengl.t
-t/palettepm.t
-t/sdlgamerect.t
-t/sdlpm.t
-t/soundpm.t
-t/surfaceML.t
-t/timerpm.t
-t/toolfontpm.t
-t/toolgraphicpm.t
-t/ttfontpm.t
-t/videopm.t
-test/64encode.pl
-test/checkkeys.pl
-test/data/24P_Arial_NeonYellow.png
-test/data/24P_Copperplate_Blue.png
-test/data/aircut3.ttf
-test/data/electrohar.ttf
-test/data/highlight.png
-test/data/icon.bmp
-test/data/LargeFont.bmp
-test/data/logo.png
-test/data/menu.png
-test/data/sample.wav
-test/graywin.pl
-test/loopwave.pl
-test/OpenGL/README
-test/OpenGL/test1.pl
-test/OpenGL/test2.pl
-test/OpenGL/test3.pl
-test/OpenGL/test4.pl
-test/OpenGL/test5.pl
-test/OpenGL/tutorial/Data/crate.png
-test/OpenGL/tutorial/Data/cube.bmp
-test/OpenGL/tutorial/Data/glass.bmp
-test/OpenGL/tutorial/Data/NeHe.png
-test/OpenGL/tutorial/Data/Star.bmp
-test/OpenGL/tutorial/Data/tim.jpg
-test/OpenGL/tutorial/Data/world.txt
-test/OpenGL/tutorial/lesson02.pl
-test/OpenGL/tutorial/lesson03.pl
-test/OpenGL/tutorial/lesson04.pl
-test/OpenGL/tutorial/lesson05.pl
-test/OpenGL/tutorial/lesson06.pl
-test/OpenGL/tutorial/lesson07.pl
-test/OpenGL/tutorial/lesson08.pl
-test/OpenGL/tutorial/lesson18.pl
-test/README
-test/testcolor.pl
-test/testcolor.spl
-test/testfonttool.pl
-test/testgfxprim.pl
-test/testgfxroto.pl
-test/testgraphictool.pl
-test/testjoystick.pl
-test/testmenu.pl
-test/testsprite.pl
-test/testtimer.pl
-test/wave.pl
-TODO
-typemap
index 5159863..0b779f5 100644 (file)
@@ -3,4 +3,4 @@ _build
 blib
 exp
 .git
-stage
+
diff --git a/lib/SDL/Video.pm b/lib/SDL/Video.pm
new file mode 100644 (file)
index 0000000..30f68a9
--- /dev/null
@@ -0,0 +1,42 @@
+package SDL::Video;
+use strict;
+use warnings;
+require Exporter;
+require DynaLoader;
+our @ISA = qw(Exporter DynaLoader);
+bootstrap SDL::Video;
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+SDL::Video - Bindings to the video category in SDL API
+
+=head1 SYNOPSIS
+
+This module is not an object. Please read the 
+
+=head1 DESCRIPTION
+
+
+
+=head1 METHODS
+
+=head2 get_video_surface
+
+=head2 get_video_info
+
+
+=head1 SEE ALSO
+
+=head2 Category Objects
+
+L<SDL::Surface>, L<SDL::Overlay>, L<SDL::Color>,
+L<SDL::Rect>, L<SDL::Palette>, L<SDL::PixelFormat>, 
+L<SDL::VideoInfo>
+
+=cut
index bb1a619..4016420 100644 (file)
@@ -21,10 +21,43 @@ See: L<http://www.libsdl.org/cgi/docwiki.cgi/SDL_API#head-813f033ec44914f267f321
 =cut
 
 SDL_Surface *
-GetVideoSurface ()
+video_get_video_surface()
+       PREINIT:
+               char* CLASS = "SDL::Surface";
        CODE:
                RETVAL = SDL_GetVideoSurface();
        OUTPUT:
                RETVAL
 
 
+HV *
+video_get_video_info()
+       CODE:
+               HV *hv;
+               SDL_VideoInfo *info;
+               info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
+               memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
+               hv = newHV();
+               hv_store(hv,"hw_available",strlen("hw_available"),
+                       newSViv(info->hw_available),0);
+               hv_store(hv,"wm_available",strlen("wm_available"),
+                       newSViv(info->wm_available),0);
+               hv_store(hv,"blit_hw",strlen("blit_hw"),
+                       newSViv(info->blit_hw),0);
+               hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
+                       newSViv(info->blit_hw_CC),0);
+               hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
+                       newSViv(info->blit_hw_A),0);
+               hv_store(hv,"blit_sw",strlen("blit_sw"),
+                       newSViv(info->blit_sw),0);
+               hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
+                       newSViv(info->blit_sw_CC),0);
+               hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
+                       newSViv(info->blit_sw_A),0);
+               hv_store(hv,"blit_fill",strlen("blit_fill"),
+                       newSViv(info->blit_fill),0);
+               hv_store(hv,"video_mem",strlen("video_mem"),
+                       newSViv(info->video_mem),0);
+               RETVAL = hv;
+               OUTPUT:
+               RETVAL
index 51aa077..fe3d5d7 100644 (file)
@@ -1,8 +1,4 @@
 #!/usr/bin/perl -w
-BEGIN {
-       unshift @INC, 'blib/lib','blib/arch';
-}
-
 use strict;
 use SDL;
 use SDL::Config;
@@ -16,6 +12,16 @@ use_ok( 'SDL::Video' );
 can_ok ('SDL::Video', qw/
        get_video_surface
        get_video_info
+       /);
+
+#testing get_video_surface
+SDL::Init(SDL_INIT_VIDEO);                                                                          
+                                                                                                    
+my $display = SDL::SetVideoMode(640,480,32, SDL_SWSURFACE );
+
+isa_ok(SDL::Video::get_video_surface(), 'SDL::Surface', 'Checking if we get a surface ref back'); 
+
+=skip
        video_driver_name
        list_modes
        video_mode_ok