PageRenderTime 23ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/src/Core/objects/PixelFormat.xs

http://github.com/PerlGameDev/SDL
Unknown | 178 lines | 152 code | 26 blank | 0 comment | 0 complexity | 33c89f6036b941df9ee06a1696b53bf0 MD5 | raw file
  1#include "EXTERN.h"
  2#include "perl.h"
  3#include "XSUB.h"
  4#include "ppport.h"
  5#include "helper.h"
  6
  7#ifndef aTHX_
  8#define aTHX_
  9#endif
 10
 11#include <SDL.h>
 12
 13MODULE = SDL::PixelFormat 	PACKAGE = SDL::PixelFormat    PREFIX = pixelformat_
 14
 15=for documentation
 16
 17SDL_PixelFormat -- Stores surface format information
 18
 19  typedef struct SDL_PixelFormat {
 20    SDL_Palette *palette;
 21    Uint8  BitsPerPixel;
 22    Uint8  BytesPerPixel;
 23    Uint8  Rloss, Gloss, Bloss, Aloss;
 24    Uint8  Rshift, Gshift, Bshift, Ashift;
 25    Uint32 Rmask, Gmask, Bmask, Amask;
 26    Uint32 colorkey;
 27    Uint8  alpha;
 28  } SDL_PixelFormat;
 29
 30=cut
 31
 32SV *
 33pixelformat_palette( pixelformat )
 34	SDL_PixelFormat *pixelformat
 35	PREINIT:
 36		char* CLASS = "SDL::Palette";
 37	CODE:
 38		if(pixelformat->palette)
 39			RETVAL = cpy2bag( pixelformat->palette, sizeof(SDL_Palette *), sizeof(SDL_Palette), "SDL::Palette" );
 40		else
 41			XSRETURN_UNDEF;
 42	OUTPUT:
 43		RETVAL
 44
 45
 46Uint8
 47pixelformat_BitsPerPixel( pixelformat )
 48	SDL_PixelFormat *pixelformat
 49	CODE:
 50		RETVAL = pixelformat->BitsPerPixel;
 51	OUTPUT:
 52		RETVAL
 53
 54Uint8
 55pixelformat_BytesPerPixel( pixelformat )
 56	SDL_PixelFormat *pixelformat
 57	CODE:
 58		RETVAL = pixelformat->BytesPerPixel;
 59	OUTPUT:
 60		RETVAL
 61
 62Uint8
 63pixelformat_Rloss( pixelformat )
 64	SDL_PixelFormat *pixelformat
 65	CODE:
 66		RETVAL = pixelformat->Rloss;
 67	OUTPUT:
 68		RETVAL
 69
 70Uint8
 71pixelformat_Bloss( pixelformat )
 72	SDL_PixelFormat *pixelformat
 73	CODE:
 74		RETVAL = pixelformat->Bloss;
 75	OUTPUT:
 76		RETVAL
 77
 78Uint8
 79pixelformat_Gloss( pixelformat )
 80	SDL_PixelFormat *pixelformat
 81	CODE:
 82		RETVAL = pixelformat->Gloss;
 83	OUTPUT:
 84		RETVAL
 85
 86Uint8
 87pixelformat_Aloss( pixelformat )
 88	SDL_PixelFormat *pixelformat
 89	CODE:
 90		RETVAL = pixelformat->Aloss;
 91	OUTPUT:
 92		RETVAL
 93
 94Uint8
 95pixelformat_Rshift( pixelformat )
 96	SDL_PixelFormat *pixelformat
 97	CODE:
 98		RETVAL = pixelformat->Rshift;
 99	OUTPUT:
100		RETVAL
101
102Uint8
103pixelformat_Bshift( pixelformat )
104	SDL_PixelFormat *pixelformat
105	CODE:
106		RETVAL = pixelformat->Bshift;
107	OUTPUT:
108		RETVAL
109
110Uint8
111pixelformat_Gshift( pixelformat )
112	SDL_PixelFormat *pixelformat
113	CODE:
114		RETVAL = pixelformat->Gshift;
115	OUTPUT:
116		RETVAL
117
118Uint8
119pixelformat_Ashift( pixelformat )
120	SDL_PixelFormat *pixelformat
121	CODE:
122		RETVAL = pixelformat->Ashift;
123	OUTPUT:
124		RETVAL
125
126Uint32
127pixelformat_Rmask( pixelformat )
128	SDL_PixelFormat *pixelformat
129	CODE:
130		RETVAL = pixelformat->Rmask;
131	OUTPUT:
132		RETVAL
133
134Uint32
135pixelformat_Bmask( pixelformat )
136	SDL_PixelFormat *pixelformat
137	CODE:
138		RETVAL = pixelformat->Bmask;
139	OUTPUT:
140		RETVAL
141
142Uint32
143pixelformat_Gmask( pixelformat )
144	SDL_PixelFormat *pixelformat
145	CODE:
146		RETVAL = pixelformat->Gmask;
147	OUTPUT:
148		RETVAL
149
150Uint32
151pixelformat_Amask( pixelformat )
152	SDL_PixelFormat *pixelformat
153	CODE:
154		RETVAL = pixelformat->Amask;
155	OUTPUT:
156		RETVAL
157
158Uint32
159pixelformat_colorkey( pixelformat )
160	SDL_PixelFormat *pixelformat
161	CODE:
162		RETVAL = pixelformat->colorkey;
163	OUTPUT:
164		RETVAL
165
166Uint8
167pixelformat_alpha( pixelformat )
168	SDL_PixelFormat *pixelformat
169	CODE:
170		RETVAL = pixelformat->alpha;
171	OUTPUT:
172		RETVAL
173
174void
175pixelformat_DESTROY ( bag )
176	SV *bag
177	CODE:
178		objDESTROY(bag, safefree);