X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Video.html-inc;fp=pages%2FSDL-Video.html-inc;h=041c083d8520aa9294a9c77f37e5778dc5bf60fd;hb=92e293d6d5adcc910443bf2ef174928e266c625d;hp=c6a2ac43311d0582e250d729905e22113afd3c44;hpb=2d13cef7f6c61e09ecbc7f2e4b0cfd66c2078020;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Video.html-inc b/pages/SDL-Video.html-inc index c6a2ac4..041c083 100644 --- a/pages/SDL-Video.html-inc +++ b/pages/SDL-Video.html-inc @@ -135,7 +135,7 @@
 my $surface = SDL::Video::get_video_surface();
 
 
-

This function returns the current display SDL::Surface. If SDL is doing format conversion on the display surface, this +

This function returns the current display SDL::Surface. If SDL is doing format conversion on the display surface, this function returns the publicly visible surface, not the real video surface.

Example:

 # somewhere after you set the video mode
@@ -151,7 +151,7 @@ function returns the publicly visible surface, not the real video surface.

 my $video_info = SDL::Video::get_video_info();
 
 
-

This function returns a read-only SDL::VideoInfo containing information about the video hardware. If it is called before +

This function returns a read-only SDL::VideoInfo containing information about the video hardware. If it is called before SDL::Video::set_video_mode, the vfmt member of the returned structure will contain the pixel format of the best video mode.

Example:

@@ -262,7 +262,7 @@ It returns 0 if the mode is not supported at all, otherwise the sug

Sets up a video mode with the specified width, height, bits-per-pixel and flags. -set_video_mode returns a SDL::Surface on success otherwise it returns undef on error, the error message is retrieved +set_video_mode returns a SDL::Surface on success otherwise it returns undef on error, the error message is retrieved using SDL::get_error.

@@ -349,12 +349,12 @@ each call to SDL::Video::set_video_mode, for examp
 $converted_surface = SDL::Video::convert_surface( $surface, $format, $flags );
 
 
-

Creates a new SDL::surface of the specified SDL::PixelFormat, and then copies and maps the given surface to it. +

Creates a new SDL::surface of the specified SDL::PixelFormat, and then copies and maps the given surface to it. It is also useful for making a copy of a surface.

-

The flags parameter is passed to SDL::Surface->new and has those semantics. +

The flags parameter is passed to SDL::Surface->new and has those semantics. This function is used internally by SDL::Video::display_format. This function can only be called after SDL::init.

-

it returns a SDL::Surface on success or undef on error.

+

it returns a SDL::Surface on success or undef on error.

display_format

@@ -391,8 +391,8 @@ segfault.

 $surface = SDL::Video::load_BMP( $filename );
 
 
-

Loads a SDL::Surface from a named Windows BMP file. -SDL::Video::load_BMP returns a SDL::Surface on success or undef on error.

+

Loads a SDL::Surface from a named Windows BMP file. +SDL::Video::load_BMP returns a SDL::Surface on success or undef on error.

Note: When loading a 24-bit Windows BMP file, pixel data points are loaded as blue, green, red, and NOT red, green, blue (as one might expect).

 use SDL;
  use SDL::Video;
@@ -429,7 +429,7 @@ segfault.

 $saved_BMP = SDL::Video::save_BMP( $surface, $filename );
 
 
-

Saves the given SDL::Surface as a Windows BMP file named filename. +

Saves the given SDL::Surface as a Windows BMP file named filename. it returns 0 on success or -1 on error.

@@ -520,7 +520,7 @@ two arbitrary RGBA surfaces this way and get the result you would expect from &q
 $fill_rect = SDL::Video::fill_rect( $dest, $dest_rect, $pixel );
 
 
-

This function performs a fast fill of the given SDL::Rect with the given SDL::PixelFormat. If dest_rect is NULL, the whole surface +

This function performs a fast fill of the given SDL::Rect with the given SDL::PixelFormat. If dest_rect is NULL, the whole surface will be filled with color.

The color should be a pixel of the format used by the surface, and can be generated by the SDL::Video::map_RGB or SDL::Video::map_RGBA|/map_RGBA functions. If the color value contains an alpha value then the destination is simply "filled" with that @@ -543,7 +543,7 @@ surface to see the result. This can happen if you are using a shadowed surface t

 int SDL::Video::lock_surface( $surface );
 
 
-

SDL::Video::lock_surface sets up the given SDL::Surface for directly accessing the pixels. +

SDL::Video::lock_surface sets up the given SDL::Surface for directly accessing the pixels. Between calls to SDL::lock_surface and SDL::unlock_surface, you can write to ( surface-set_pixels>) and read from ( surface-get_pixels> ), using the pixel format stored in surface-format>. Once you are done accessing the surface, you should use SDL::Video::unlock_surface to release the lock.

@@ -660,7 +660,7 @@ Surfaces should be unlocked as soon as possible.
 SDL::Video::set_clip_rect( $surface, $rect );
 
 
-

Sets the clipping rectangle for the given SDL::Surface. When this surface is the destination of a blit, only the area within the clip +

Sets the clipping rectangle for the given SDL::Surface. When this surface is the destination of a blit, only the area within the clip rectangle will be drawn into. The rectangle pointed to by rect will be clipped to the edges of the surface so that the clip rectangle for a surface can never fall outside the edges of the surface. @@ -673,7 +673,7 @@ If rect is NULL the clipping rectangle will be set to the full size of the surfa

 SDL::Video::get_clip_rect( $surface, $rect );
 
 
-

Gets the clipping rectangle for the given SDL::Surface. When this surface is the destination of a blit, only the area within the clip +

Gets the clipping rectangle for the given SDL::Surface. When this surface is the destination of a blit, only the area within the clip rectangle is drawn into. The rectangle pointed to by rect will be filled with the clipping rectangle of the surface. SDL::Video::get_clip_rect doesn't returns anything;

@@ -705,7 +705,7 @@ The rectangle pointed to by rect will be filled with the clipping rectangle of t
 SDL::Video::blit_surface( $src_surface, $src_rect, $dest_surface, $dest_rect );
 
 
-

This performs a fast blit from the given source SDL::Surface to the given destination SDL::Surface. +

This performs a fast blit from the given source SDL::Surface to the given destination SDL::Surface. The width and height in src_surface determine the size of the copied rectangle. Only the position is used in the dst_rect (the width and height are ignored). Blits with negative dst_rect coordinates will be clipped properly. If src_rect is NULL, the entire surface is copied. If dst_rect is NULL, then the destination position (upper left corner) is (0, 0). @@ -833,7 +833,7 @@ instead.

When surface is the surface associated with the current display, the display colormap will be updated with the requested colors. If SDL_HWPALETTE was set in SDL::Video::set_video_mode flags, SDL::Video::set_colors will always return 1, and the palette is guaranteed to be set the way you desire, even if the window colormap has to be warped or run under emulation. -The color components of a SDL::Color structure are 8-bits in size, giving you a total of 2563 = 16777216 colors. +The color components of a SDL::Color structure are 8-bits in size, giving you a total of 2563 = 16777216 colors. Palettized (8-bit) screen surfaces with the SDL_HWPALETTE flag have two palettes, a logical palette that is used for mapping blits to/from the surface and a physical palette (that determines how the hardware will map the colors to the display). SDL::Video::set_colors modifies both palettes (if present), and is equivalent to calling SDL::Video::set_palette with the @@ -1007,11 +1007,11 @@ with SDL::Video::set_gamma.

 $pixel = SDL::Video::map_RGB( $pixel_format, $r, $g, $b );
 
 
-

Maps the RGB color value to the specified SDL::PixelFormat and returns the pixel value as a 32-bit int. +

Maps the RGB color value to the specified SDL::PixelFormat and returns the pixel value as a 32-bit int. If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned. If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque).

SDL::Video::map_RGB returns a pixel value best approximating the given RGB color value for a given pixel format. -If the SDL::PixelFormat's bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored +If the SDL::PixelFormat's bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).

 use SDL;
  use SDL::Video;
@@ -1049,7 +1049,7 @@ If the SDL::PixelFormat's  bpp (color depth)
 
 $pixel = SDL::Video::map_RGB( $pixel_format, $r, $g, $b, $a );
 
 
-

Maps the RGBA color value to the specified SDL::PixelFormat and returns the pixel value as a 32-bit int. +

Maps the RGBA color value to the specified SDL::PixelFormat and returns the pixel value as a 32-bit int. If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned. If the specified pixel format has no alpha component the alpha value will be ignored (as it will be in formats with a palette).

A pixel value best approximating the given RGBA color value for a given pixel format. @@ -1186,7 +1186,7 @@ or disabled using the SDL_GL_DOUBLEBUFFER attribute.

Video Overlay Functions

Top

lock_YUV_overlay

@@ -1212,7 +1212,7 @@ can be displayed. unlock_YUV_overlay does not return anything.

 $display_overlay = SDL::Video::display_YUV_overlay( $overlay, $dstrect );
 
 
-

Blit the overlay to the display surface specified when the overlay was created. The SDL::Rect structure, dstrect, specifies a rectangle +

Blit the overlay to the display surface specified when the overlay was created. The SDL::Rect structure, dstrect, specifies a rectangle on the display where the overlay is drawn. The x and y fields of dstrect specify the upper left location in display coordinates. The overlay is scaled (independently in x and y dimensions) to the size specified by dstrect, and is optimized for 2x scaling

It returns 0 on success or -1 on error.

@@ -1282,7 +1282,7 @@ bar or desktop when the window is minimized). As with title this string may be f

Sets the icon for the display window. Win32 icons must be 32x32.

-

This function must be called before the first call to SDL::Video::set_video_mode. Note that this means SDL::Image +

This function must be called before the first call to SDL::Video::set_video_mode. Note that this means SDL::Image cannot be used.

The shape is determined by the colorkey or alpha channel of the icon, if any. If neither of those are present, the icon is made opaque (no transparency).

@@ -1326,7 +1326,7 @@ and not interpreted by a window manager, if any.

If the application is running in a window managed environment SDL attempts to iconify/minimise it. If wm_iconify_window is successful, -the application will receive a SDL_APPACTIVE loss event (see Application visibility events at SDL::Event).

+the application will receive a SDL_APPACTIVE loss event (see Application visibility events at SDL::Event).

Returns non-zero on success or 0 if iconification is not supported or was refused by the window manager.

Example:

 use SDL;
@@ -1368,9 +1368,9 @@ is experimental).

Category Objects

-

SDL::Surface, SDL::Overlay, SDL::Color, -SDL::Rect, SDL::Palette, SDL::PixelFormat, -SDL::VideoInfo

+

SDL::Surface, SDL::Overlay, SDL::Color, +SDL::Rect, SDL::Palette, SDL::PixelFormat, +SDL::VideoInfo

\ No newline at end of file