This work but I warnings of incompatible pointer to sv_2mortal
[sdlgit/SDL_perl.git] / src / Core / Video.xs
CommitLineData
70fd0f8d 1#include "EXTERN.h"
2#include "perl.h"
3#include "XSUB.h"
4
5#ifndef aTHX_
6#define aTHX_
7#endif
8
9#include <SDL.h>
10
11MODULE = SDL::Video PACKAGE = SDL::Video PREFIX = video_
12
13=for documentation
14
15The Following are XS bindings to the Video category in the SDL API v2.1.13
16
17Describe on the SDL API site.
18
19See: L<http://www.libsdl.org/cgi/docwiki.cgi/SDL_API#head-813f033ec44914f267f32195aba7d9aff8c410c0>
20
21=cut
22
23SDL_Surface *
95f5be30 24video_get_video_surface()
25 PREINIT:
26 char* CLASS = "SDL::Surface";
70fd0f8d 27 CODE:
28 RETVAL = SDL_GetVideoSurface();
29 OUTPUT:
30 RETVAL
31
32
20f544ea 33SDL_VideoInfo*
95f5be30 34video_get_video_info()
20f544ea 35 PREINIT:
36 char* CLASS = "SDL::VideoInfo";
95f5be30 37 CODE:
20f544ea 38 RETVAL = SDL_GetVideoInfo;
8a2411d0 39
40 OUTPUT:
20f544ea 41 RETVAL
8a2411d0 42
43char *
44video_video_driver_name( maxlen )
45 int maxlen
46 CODE:
47 char* buffer = safemalloc( sizeof(char) * maxlen);
48 char* str = SvPV( newSVpvn( buffer , maxlen), maxlen );
49
50 RETVAL = SDL_VideoDriverName( str , maxlen);
51
52 sv_2mortal(buffer);
53
54 OUTPUT:
55 RETVAL