SDL::Surface(e)User Contributed Perl DocumentationSDL::Surface(e) NAME SDL::Surface - a SDL perl extension SYNOPSIS use SDL::Surface; $image = new SDL::Surface(-name=>"yomama.jpg"); DESCRIPTION The "SDL::Surface" module encapsulates the SDL_Surface* structure, and many of its ancillatory functions. Not only is it a workhorse of the OO Layer, it is the base class for the "SDL::App" class. new (-name => 'foo.png') The "SDL::Surface" class can be instantiated in a number of different ways. If support for the SDL_image library was included when SDL_perl was compiled, the easiest way to create a new surface is to use the "SDL::Surface::new" method with the "-name" option. This will load the image from the file and return an object encapsulating the SDL_Surface*. new (-from => $buffer, ... ) If the contents of the new Surface is already in memory, "SDL::Surface::new" may be called with the "-from" option to create an image from that section of memory. This method takes the following additional parameters: o -width the width of the image in pixels o -height the height of the image in pixels o -depth the number of bits per pixel o -pitch the number of bytes per line o -Rmask an optional bitmask for red o -Gmask an optional bitmask for green o -Bmask an optional bitmask for green o -Amask an optional bitmask for alpha new ( -flags => SDL_SWSURFACE, ... ) Finally, "SDL::Suface::new" may be invoked with the "-flags" option, in a similar fashion to the "-from" directive. This invocation takes the same additional options as "-from" with the exception of "-pitch" which is ignored. This method returns a new, blank, SDL::Surface option with any of the following flags turned on: o SWSURFACE() a non-accelerated surface o HWSURFACE() a hardware accelerated surface o SRCCOLORKEY() a surface with a transperant color o SRCALPHA() an alpha blended, translucent surface flags () "SDL::Surface::flags" returns the flags with which the surface was initialized. palette () bpp () bytes_per_pixel () Rshift () Gshift () Bshift () Ashift () Rmask () Gmask () Bmask () Amask () color_key () alpha () width () height () pitch () pixels () pixel () fill () lockp () lock () unlock () update () flip () blit () set_colors () set_color_key () set_alpha () display_format () print () save_bmp () video_info () AUTHOR David J. Goehrig SEE ALSO perl(l) SDL::Rect(t) SDL::Font(t) SDL::App(p). perl v5.6.1 2002-04-05 SDL::Surface(e)