PageRenderTime 26ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/src/Core/objects/VideoInfo.xs

http://github.com/PerlGameDev/SDL
Unknown | 179 lines | 123 code | 56 blank | 0 comment | 0 complexity | bd15e6241a799c529d5f6e43ef581d40 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::VideoInfo 	PACKAGE = SDL::VideoInfo    PREFIX = videoinfo_
 14
 15=for documentation
 16
 17SDL_VideoInfo -- Video target information
 18
 19typedef struct{
 20    Uint32 hw_available:1;
 21    Uint32 wm_available:1;
 22    Uint32 blit_hw:1;
 23    Uint32 blit_hw_CC:1;
 24    Uint32 blit_hw_A:1;
 25    Uint32 blit_sw:1;
 26    Uint32 blit_sw_CC:1;
 27    Uint32 blit_sw_A:1;
 28    Uint32 blit_fill:1;
 29    Uint32 video_mem;
 30    SDL_PixelFormat *vfmt;
 31    int current_w;
 32    int current_h;
 33} SDL_VideoInfo;
 34
 35
 36
 37=cut
 38
 39Uint32
 40videoinfo_hw_available( videoinfo )
 41
 42	SDL_VideoInfo *videoinfo
 43	
 44	CODE:
 45		RETVAL = videoinfo->hw_available;
 46	OUTPUT:
 47		RETVAL
 48
 49Uint32
 50videoinfo_wm_available( videoinfo )
 51
 52	SDL_VideoInfo *videoinfo
 53	
 54	CODE:
 55		RETVAL = videoinfo->wm_available;
 56	OUTPUT:
 57		RETVAL
 58
 59Uint32
 60videoinfo_blit_hw( videoinfo )
 61
 62	SDL_VideoInfo *videoinfo
 63	
 64	CODE:
 65		RETVAL = videoinfo->blit_hw;
 66	OUTPUT:
 67		RETVAL
 68
 69Uint32
 70videoinfo_blit_hw_CC( videoinfo )
 71
 72	SDL_VideoInfo *videoinfo
 73	
 74	CODE:
 75		RETVAL = videoinfo->blit_hw_CC;
 76	OUTPUT:
 77		RETVAL
 78
 79
 80Uint32
 81videoinfo_blit_hw_A( videoinfo )
 82
 83	SDL_VideoInfo *videoinfo
 84	
 85	CODE:
 86		RETVAL = videoinfo->blit_hw_A;
 87	OUTPUT:
 88		RETVAL
 89
 90Uint32
 91videoinfo_blit_sw( videoinfo )
 92
 93	SDL_VideoInfo *videoinfo
 94	
 95	CODE:
 96		RETVAL = videoinfo->blit_sw;
 97	OUTPUT:
 98		RETVAL
 99
100Uint32
101videoinfo_blit_sw_CC( videoinfo )
102
103	SDL_VideoInfo *videoinfo
104	
105	CODE:
106		RETVAL = videoinfo->blit_sw_CC;
107	OUTPUT:
108		RETVAL
109
110
111Uint32
112videoinfo_blit_sw_A( videoinfo )
113
114	SDL_VideoInfo *videoinfo
115	
116	CODE:
117		RETVAL = videoinfo->blit_sw_A;
118	OUTPUT:
119		RETVAL
120
121Uint32
122videoinfo_blit_fill( videoinfo )
123
124	SDL_VideoInfo *videoinfo
125	
126	CODE:
127		RETVAL = videoinfo->blit_fill;
128	OUTPUT:
129		RETVAL
130
131Uint32
132videoinfo_video_mem( videoinfo )
133
134	SDL_VideoInfo *videoinfo
135	
136	CODE:
137		RETVAL = videoinfo->video_mem;
138	OUTPUT:
139		RETVAL
140
141
142SV *
143videoinfo_vfmt( videoinfo )
144
145	SDL_VideoInfo *videoinfo
146	PREINIT:
147		char* CLASS = "SDL::PixelFormat";
148	CODE:
149		RETVAL = cpy2bag( videoinfo->vfmt, sizeof(SDL_PixelFormat *), sizeof(SDL_PixelFormat), "SDL::PixelFormat" );
150	OUTPUT:
151		RETVAL
152
153
154#if SDL_MAJOR_VERSION >= 1 && SDL_MINOR_VERSION >=2 && SDL_PATCHLEVEL >=10
155
156int
157videoinfo_current_w( videoinfo )
158
159	SDL_VideoInfo *videoinfo
160	
161	CODE:
162		RETVAL = videoinfo->current_w;
163	OUTPUT:
164		RETVAL
165
166int
167videoinfo_current_h( videoinfo )
168
169	SDL_VideoInfo *videoinfo
170	
171	CODE:
172		RETVAL = videoinfo->current_h;
173	OUTPUT:
174		RETVAL
175
176#endif
177
178	
179