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; goto all_done; }
148 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
149 for ( i = 0; i < length ; i++ ) {
150 temp = (SDL_Color *)SvIV(ST(i+2));
151 colors[i].r = temp->r;
152 colors[i].g = temp->g;
153 colors[i].b = temp->b;
155 RETVAL = SDL_SetColors(surface, colors, start, length );