X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2FCore%2FVideo.xs;h=3c964e7e2558b265a4ad7ac8cba941db3cb3b378;hb=8a2411d0d946d83256c0b781d09ec76eae19275a;hp=401642080a57fdd3827922b2e87bc1562bc35e9f;hpb=95f5be308db86ed665a21a6d0c99aa5acb0b3409;p=sdlgit%2FSDL_perl.git diff --git a/src/Core/Video.xs b/src/Core/Video.xs index 4016420..3c964e7 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -30,34 +30,26 @@ video_get_video_surface() RETVAL -HV * +SDL_VideoInfo* video_get_video_info() + PREINIT: + char* CLASS = "SDL::VideoInfo"; + CODE: + RETVAL = SDL_GetVideoInfo; + + OUTPUT: + RETVAL + +char * +video_video_driver_name( maxlen ) + int maxlen 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: + char* buffer = safemalloc( sizeof(char) * maxlen); + char* str = SvPV( newSVpvn( buffer , maxlen), maxlen ); + + RETVAL = SDL_VideoDriverName( str , maxlen); + + sv_2mortal(buffer); + + OUTPUT: RETVAL