PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Core/objects/Overlay.xs

http://github.com/PerlGameDev/SDL
Unknown | 87 lines | 71 code | 16 blank | 0 comment | 0 complexity | 3ba401009a4a3cc2aefeb25303abec40 MD5 | raw file
 1#include "EXTERN.h"
 2#include "perl.h"
 3#include "XSUB.h"
 4#include "ppport.h"
 5
 6#ifndef aTHX_
 7#define aTHX_
 8#endif
 9
10#include <SDL.h>
11
12MODULE = SDL::Overlay 	PACKAGE = SDL::Overlay    PREFIX = overlay_
13
14=for documentation
15
16SDL_Overlay -- YUV video overlay
17
18typedef struct{
19  Uint32 format;
20  int w, h;
21  int planes;
22  Uint16 *pitches;
23  Uint8 **pixels;
24  Uint32 hw_overlay:1;
25} SDL_Overlay;
26
27
28=cut
29
30SDL_Overlay *
31overlay_new(CLASS, width, height, format, display)
32	char* CLASS
33	int width
34	int height
35	Uint32 format
36	SDL_Surface *display;
37	CODE:
38		RETVAL = SDL_CreateYUVOverlay(width, height, format, display);
39	OUTPUT:
40		RETVAL
41
42int
43overlay_w( overlay )
44	SDL_Overlay* overlay
45	CODE:
46		RETVAL = overlay->w;
47	OUTPUT:
48		RETVAL
49
50int
51overlay_h( overlay )
52	SDL_Overlay* overlay
53	CODE:
54		RETVAL = overlay->h;
55	OUTPUT:
56		RETVAL
57
58int
59overlay_planes( overlay )
60	SDL_Overlay* overlay
61	CODE:
62		RETVAL = overlay->planes;
63	OUTPUT:
64		RETVAL
65
66Uint32 
67overlay_hwoverlay( overlay )
68	SDL_Overlay* overlay
69	CODE:
70		RETVAL = overlay->hw_overlay;		
71	OUTPUT:
72		RETVAL
73
74Uint32
75overlay_format( overlay )
76	SDL_Overlay* overlay
77	CODE:
78		RETVAL = overlay->format;		
79	OUTPUT:
80		RETVAL
81
82
83void
84overlay_DESTROY(overlay)
85	SDL_Overlay *overlay
86	CODE:
87		SDL_FreeYUVOverlay(overlay);