X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDLx-Surface.html-inc;h=e2b519622e5a15ec1bee726706cfa336af5be517;hb=33a8f248a8db04af5001502a1a2f3cd1c28e7677;hp=873310b64c05ae944fb7a036fa531bcf1fa23e48;hpb=505f308d8b092747da8b2f5e9781475a1f06dfe8;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDLx-Surface.html-inc b/pages/SDLx-Surface.html-inc index 873310b..e2b5196 100644 --- a/pages/SDLx-Surface.html-inc +++ b/pages/SDLx-Surface.html-inc @@ -19,7 +19,8 @@
my $surface = SDLx::Surface->load( 'hero.png' ); + my $surface = SDLx::Surface->load( 'hero.dat', 'bmp' ); + ++
Loads the given image file into a new SDLx::Surface surface. A new +surface is always created, even if you call it from an already crafted +object. Croaks on errors such as no support built for that image extension +or a file reading error (the error message is SDL::get_error and should +give more details).
+Note that load() will automatically figure out the extension based on the +filename you provide. If you wish to force an extension for whatever reason +(like having a filename with a different extension or none at all), you can +optionally pass the file type as a second parameter. Case is not relevant.
+If you don't have SDL_image in your build, only bitmap images will be +supported.
+Returns the new Surface.
+ + + + + +$sdlx_surface->blit( $dest, $src_rect, $dest_rect );