X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2FCore%2FVideo.xs;h=753bca650ad5cd49750a51bcf90b7f5e3658b78d;hb=7dda1934e967f3a8e07a01546aa498b4e53a08ed;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=acad99c79963fadc3015d75565b515b61b2ee058;p=sdlgit%2FSDL_perl.git diff --git a/src/Core/Video.xs b/src/Core/Video.xs index e69de29..753bca6 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -0,0 +1,79 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#ifndef aTHX_ +#define aTHX_ +#endif + +#include + +MODULE = SDL::Video PACKAGE = SDL::Video PREFIX = video_ + +=for documentation + +The Following are XS bindings to the Video category in the SDL API v2.1.13 + +Describe on the SDL API site. + +See: L + +=cut + +SDL_Surface * +video_get_video_surface() + PREINIT: + char* CLASS = "SDL::Surface"; + CODE: + RETVAL = SDL_GetVideoSurface(); + OUTPUT: + RETVAL + + +SDL_VideoInfo* +video_get_video_info() + PREINIT: + char* CLASS = "SDL::VideoInfo"; + CODE: + RETVAL = (SDL_VideoInfo *) SDL_GetVideoInfo(); + + OUTPUT: + RETVAL + +SV * +video_video_driver_name( ) + + CODE: + char buffer[1024]; + if ( SDL_VideoDriverName(buffer, 1024) != NULL ) + { + RETVAL = newSVpv(buffer, 0); + } + else + XSRETURN_UNDEF; + OUTPUT: + RETVAL + +AV* +list_modes ( format, flags ) + Uint32 flags + SDL_PixelFormat *format + CODE: + SDL_Rect **mode; + RETVAL = newAV(); + mode = SDL_ListModes(format,flags); + if (mode == (SDL_Rect**)-1 ) { + av_push(RETVAL,newSVpv("all",0)); + } else if (! mode ) { + av_push(RETVAL,newSVpv("none",0)); + } else { + for (;*mode;mode++) { + av_push(RETVAL,newSViv(PTR2IV(*mode))); + } + } + OUTPUT: + RETVAL + + + +