PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/GFX/GFX.xs

http://github.com/PerlGameDev/SDL
Unknown | 60 lines | 44 code | 16 blank | 0 comment | 0 complexity | afb6ad92147464b743f66eccd79b1d35 MD5 | raw file
 1#include "EXTERN.h"
 2#include "perl.h"
 3#include "XSUB.h"
 4
 5#include <SDL.h>
 6#ifdef HAVE_SDL_GFX_PRIMITIVES
 7#include <SDL_gfxPrimitives.h>
 8#endif
 9	SDL_version *linked_version = NULL; 
10
11
12#ifndef SDL_GFXPRIMITIVES_MAJOR
13#define SDL_GFXPRIMITIVES_MAJOR 0
14#endif
15
16#ifndef SDL_GFXPRIMITIVES_MINOR
17#define SDL_GFXPRIMITIVES_MINOR 0
18#endif
19
20#ifndef SDL_GFXPRIMITIVES_MICRO
21#define SDL_GFXPRIMITIVES_MICRO 0
22#endif
23
24#ifndef SDL_GFXPRIMITIVES_VERSION
25#define SDL_GFXPRIMITIVES_VERSION(X)      \
26{                                         \
27	(X)->major = SDL_GFXPRIMITIVES_MAJOR; \
28	(X)->minor = SDL_GFXPRIMITIVES_MINOR; \
29	(X)->patch = SDL_GFXPRIMITIVES_MICRO; \
30}
31#endif
32
33MODULE = SDL::GFX 	PACKAGE = SDL::GFX    PREFIX = gfx_
34
35=for documentation
36
37The Following are XS bindings to the SDL_gfx Library
38
39Described here:
40
41See: L<http:/*www.ferzkopp.net/joomla/content/view/19/14/> */
42
43=cut
44
45const SDL_version *
46gfx_linked_version()
47	PREINIT:
48		char* CLASS = "SDL::Version";
49	CODE:
50		if(linked_version == NULL)
51		{
52			linked_version = safemalloc(sizeof(SDL_version));
53		}
54		SDL_GFXPRIMITIVES_VERSION(linked_version);
55		
56		RETVAL = linked_version;
57	OUTPUT:
58		RETVAL
59
60