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 @@
An SDLx::Surface
allows matrix read and write to a surface, safely.
If a SDL::Surface is passed it is attached to the matrix. Returns the SDL::Surface that is currently attached to this SDLx::Surface
+ + +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 usedor 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.
Does a attributes only, no pixel, copy of another SDLx::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
+ +Returns the inner SDL::Surface's respective attribute. See SDL::Surface
.
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
.
Applies SDL::Video::update_rect for no rect or 1 array ref. Applies SDL::Video::update_rects for array of SDL::Rects.
Returns $self
+ + + +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
++kthakore