This work but I warnings of incompatible pointer to sv_2mortal
Kartik Thakore [Fri, 23 Oct 2009 19:17:13 +0000 (15:17 -0400)]
src/Core/Video.xs
t/core_video.t

index 289d749..3c964e7 100644 (file)
@@ -36,5 +36,20 @@ video_get_video_info()
                char* CLASS = "SDL::VideoInfo";
        CODE:
                RETVAL = SDL_GetVideoInfo;
-               OUTPUT:
+
+       OUTPUT:
        RETVAL
+
+char *
+video_video_driver_name( maxlen )
+       int maxlen
+       CODE:
+               char* buffer = safemalloc( sizeof(char) * maxlen); 
+               char* str = SvPV( newSVpvn( buffer , maxlen), maxlen );
+
+               RETVAL = SDL_VideoDriverName( str , maxlen);
+
+               sv_2mortal(buffer);             
+               
+       OUTPUT:
+               RETVAL
index 52b4d0b..a0e45c2 100644 (file)
@@ -12,6 +12,7 @@ use_ok( 'SDL::Video' );
 can_ok ('SDL::Video', qw/
        get_video_surface
        get_video_info
+       video_driver_name
        /);
 
 #testing get_video_surface
@@ -24,7 +25,6 @@ isa_ok(SDL::Video::get_video_surface(), 'SDL::Surface', 'Checking if we get a su
 isa_ok(SDL::Video::get_video_info(), 'SDL::VideoInfo', 'Checking if we get videoinfo ref back');
 
 =skip
-       video_driver_name
        list_modes
        video_mode_ok
        set_video_mode