11 MODULE = SDL::Video PACKAGE = SDL::Video PREFIX = video_
15 The Following are XS bindings to the Video category in the SDL API v2.1.13
17 Describe on the SDL API site.
19 See: L<http://www.libsdl.org/cgi/docwiki.cgi/SDL_API#head-813f033ec44914f267f32195aba7d9aff8c410c0>
24 video_get_video_surface()
26 char* CLASS = "SDL::Surface";
28 RETVAL = SDL_GetVideoSurface();
34 video_get_video_info()
36 char* CLASS = "SDL::VideoInfo";
38 RETVAL = (SDL_VideoInfo *) SDL_GetVideoInfo();
44 video_video_driver_name( )
48 if ( SDL_VideoDriverName(buffer, 1024) != NULL )
50 RETVAL = newSVpv(buffer, 0);
58 list_modes ( format, flags )
60 SDL_PixelFormat *format
65 mode = SDL_ListModes(format,flags);
66 if (mode == (SDL_Rect**)-1 ) {
67 av_push(RETVAL,newSVpv("all",0));
69 av_push(RETVAL,newSVpv("none",0));
72 av_push(RETVAL,newSViv(PTR2IV(*mode)));
80 video_video_mode_ok ( width, height, bpp, flags )
86 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
92 video_set_video_mode ( width, height, bpp, flags )
98 char* CLASS = "SDL::Surface";
100 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
106 video_update_rect ( surface, x, y, w ,h )
113 SDL_UpdateRect(surface,x,y,w,h);
116 video_update_rects ( surface, ... )
121 if ( items < 2 ) return;
122 num_rects = items - 1;
123 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
124 for(i=0;i<num_rects;i++) {
125 rects[i] = *(SDL_Rect *)SvIV((SV*)SvRV( ST(i + 1) ));
127 SDL_UpdateRects(surface,num_rects,rects);
132 video_flip ( surface )
135 RETVAL = SDL_Flip(surface);
140 video_set_colors ( surface, start, ... )
144 SDL_Color *colors,*temp;
146 if ( items < 3 ) { RETVAL = 0;}
150 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
151 for ( i = 0; i < length ; i++ ) {
152 temp = (SDL_Color *)SvIV(ST(i+2));
153 colors[i].r = temp->r;
154 colors[i].g = temp->g;
155 colors[i].b = temp->b;
157 RETVAL = SDL_SetColors(surface, colors, start, length );
165 video_set_palette ( surface, flags, start, ... )
171 SDL_Color *colors,*temp;
179 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
180 for ( i = 0; i < length ; i++ ){
181 temp = (SDL_Color *)SvIV(ST(i+3));
182 colors[i].r = temp->r;
183 colors[i].g = temp->g;
184 colors[i].b = temp->b;
186 RETVAL = SDL_SetPalette(surface, flags, colors, start, length );
193 video_set_gamma(r, g, b)
198 RETVAL = SDL_SetGamma(r,g,b);
204 video_set_gamma_ramp( ... )
206 Uint16 *redtable, *greentable, *bluetable;
207 RETVAL = SDL_SetGammaRamp(NULL, NULL, NULL);