X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=blobdiff_plain;f=pages%2FSDLx-Surface.html-inc;h=0148bde8228abff7cfa58bf034695b159cbb2d82;hp=195a24dc6d7b31bf6c1aad5d1982392a25bceb53;hb=807ae0cdf3bf7e415bbb01449976c9ab91209cbb;hpb=30fd24c26cb4e59a5937d49aa4810269ace3a8b0 diff --git a/pages/SDLx-Surface.html-inc b/pages/SDLx-Surface.html-inc index 195a24d..0148bde 100644 --- a/pages/SDLx-Surface.html-inc +++ b/pages/SDLx-Surface.html-inc @@ -6,16 +6,24 @@
  • CATEGORY
  • SYNOPSIS
  • DESCRIPTION
  • -
  • METHODS +
  • CONSTRUCTOR +
  • +
  • ATTRIBUTES +
  • EXTENSIONS
  • AUTHOR @@ -45,7 +53,7 @@ my $surf_matrix = SDLx::Surface->new( surface => $display); - $surf__matrix->[10][10] = 0xFFFF; #for 16bpp write white at x = 10 and y=10 + $surf_matrix->[10][10] = 0xFFFF; #for 16bpp write white at x = 10 and y=10 $surf_matrix->surface( $new_surface ); @@ -59,8 +67,8 @@

    An SDLx::Surface allows matrix read and write to a surface, safely.

    -

    METHODS

    Top

    -
    +

    CONSTRUCTOR

    Top

    +

    new

    @@ -78,31 +86,53 @@ SDLx::Surface->new( width=> 400, height=>200, flags=> SDL_SWSURFACE, depth=>32, greenmask=>0xFF000000 ) # A SDL::Surface->new( SDL_ANYFORMAT, 400, 200, 32, 0, 0xFF000000,0, 0, 0 ) is loaded - -
    -

    surface

    -
    -

    If a SDL::Surface is passed it is attached to the matrix. Returns the SDL::Surface that is currently attached to this SDLx::Surface

    + + +
    -

    get_display

    -
    +

    display

    +

    If SDLx::App::new or SDL::Video::get_video_mode called before then:

    -
     my $appx = SDLx::Surface::get_display(); 
    +
     my $appx = SDLx::Surface::display(); 
     
     

    gets the display if it is already made. Passed options are ignored. Otherwise you can quickly make the display with :

    -
     SDLx::Surface::get_display( width => 20, height => 20) #depth => 32 and SDL_ANYFORMAT used
    +
     SDLx::Surface::display( width => 20, height => 20) #depth => 32 and SDL_ANYFORMAT used
     
     

    or you can also pass flags and depth.

    -
     SDLx::Surface::get_display( width => 20, height => 20, flags=> SDL_HWSURFACE, depth=>24) 
    +
     SDLx::Surface::display( width => 20, height => 20, flags=> SDL_HWSURFACE, depth=>24) 
     
     

    Get or create the main display surface and attach to a SDLx::Surface.

    +

    duplicate

    +
    +

    Does a attributes only, no pixel, copy of another SDLx::Surface.

    + +
    +

    ATTRIBUTES

    Top

    +
    + +
    +

    surface

    +
    +

    If a SDL::Surface is passed it is attached to the matrix. Returns the SDL::Surface that is currently attached to this SDLx::Surface

    + +
    +

    w, h, format, pitch, flags

    +
    +

    Returns the inner SDL::Surface's respective attribute. See SDL::Surface.

    + +
    +

    clip_rect

    +
    +

    Sets the passed SDL::Rect as the new clip_rect for the surface. Returns the SDL::Surface's clip_rect. See SDL::Video::get_clip_rect and SDL::Video::set_clip_rect.

    + +

    EXTENSIONS

    Top

    @@ -134,13 +164,34 @@ $src_rect or $dest_rect are optional. $src_rect or $dest_rect can be array refs

    Applies SDL::Video::update_rect for no rect or 1 array ref. Applies SDL::Video::update_rects for array of SDL::Rects.

    Returns $self

    + + + +
    -

    AUTHOR

    Top

    -
    -
     kthakore 
    +

    draw_rect

    +
    +
     $sdlx_surface->draw_rect( [$x,$y,$w,$h], 0xFFFF00FF );
    + $sdlx_surface->draw_rect( SDL::Rect->new($x,$y,$w,$h), 0xFFFF00FF );
     
    +
    +

    Draws a rect on the surface with the given color.

    +

    Returns $self

    +
    +

    draw_line

    +
    +
     $sdlx_surface->draw_line( [$x1, $y1], [$x2, $y2], $color, $antialias); # $color is a number
    + $sdlx_surface->draw_line( [$x1, $y1], [$x2, $y2], \@color, $antialias); # 
    +
    +
    +

    Draws a line on the surface. Antialias is turned on if $antialias is defined.

    +

    Returns $self

    +
    +

    AUTHOR

    Top

    +
    +
     kthakore