OUTPUT:
RETVAL
-void
-surface_update_rects ( surface, ... )
- SDL_Surface *surface
- CODE:
- SDL_Rect *rects, *temp;
- int num_rects,i;
- if ( items < 2 ) return;
- num_rects = items - 1;
-
- rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
- for(i=0;i<num_rects;i++) {
- temp = (SDL_Rect *)SvIV(ST(i+1));
- rects[i].x = temp->x;
- rects[i].y = temp->y;
- rects[i].w = temp->w;
- rects[i].h = temp->h;
- }
- SDL_UpdateRects(surface,num_rects,rects);
- safefree(rects);
-
Uint16
surface_pitch( surface )
SDL_Surface *surface
OUTPUT:
RETVAL
+void
+UpdateRects ( surface, ... )
+ SDL_Surface *surface
+ CODE:
+ SDL_Rect *rects;
+ int num_rects,i;
+ if ( items < 2 ) return;
+ num_rects = items - 1;
+ rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
+ for(i=0;i<num_rects;i++) {
+ rects[i] = *(SDL_Rect *)SvIV((SV*)SvRV( ST(i + 1) ));
+ }
+ SDL_UpdateRects(surface,num_rects,rects);
+ safefree(rects);
+
=for comment
Comment out for now as it does not compile
OUTPUT:
RETVAL
-void
-UpdateRects ( surface, ... )
- SDL_Surface *surface
- CODE:
- SDL_Rect *rects, *temp;
- int num_rects,i;
- if ( items < 2 ) return;
- num_rects = items - 1;
- SDL_UpdateRects(surface,num_rects,rects);
- rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
- for(i=0;i<num_rects;i++) {
- temp = (SDL_Rect *)SvIV(ST(i+1));
- rects[i].x = temp->x;
- rects[i].y = temp->y;
- rects[i].w = temp->w;
- rects[i].h = temp->h;
- }
- SDL_UpdateRects(surface,num_rects,rects);
- safefree(rects);
-
int
Flip ( surface )
SDL_Surface *surface
my $blue_pixel = SDL::MapRGB( $app_pixel_format, 0x00, 0x00, 0xff );
SDL::FillRect( $app, $rect, $blue_pixel );
SDL::UpdateRect( $app, 0, 0, 0, 0 );
+SDL::UpdateRects( $app, $small_rect );
diag( 'This is in surface : ' . SDL::Surface::get_pixels($app) );