X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=sdlgit%2FSDL-Site.git;a=blobdiff_plain;f=pages%2FSDL-Video.html-inc;h=86b96b89bbe5f764720e232ca9e2273c4bd424f6;hp=91d483ae8b83ab0e77b879f531207abc9d94f704;hb=5ce48b7ebb54cf63bf5fb7ffb7d5f9213f8d45a9;hpb=f373167ec31ba16ae0770ba461f9de43f41a7ac1 diff --git a/pages/SDL-Video.html-inc b/pages/SDL-Video.html-inc index 91d483a..86b96b8 100644 --- a/pages/SDL-Video.html-inc +++ b/pages/SDL-Video.html-inc @@ -97,8 +97,8 @@

SYNOPSIS

Top

-
 use SDL ':init';
- use SDL::Video ':all';
+
 use SDL;
+ use SDL::Video;
  use SDL::Surface;
  use SDL::Rect;
 
@@ -275,8 +275,16 @@ word identifier like "x11", "windib" my @modes = @{ SDL::Video::list_modes( $pixel_format, $flags ) };
 
 
-

Returns a ref to an array of available screen dimensions for the given format and video flags, -or it return undef if no modes are available.

+

Returns a reference to an array:

+
+
* +of available screen dimensions (as SDL::Rect's) for the given format and video flags.
+
* +with first array element 'all'. In this case you can set all modes.
+
* +with first array element 'none' if no mode is available.
+
+

Note: <list_modes> should be called before the video_mode ist set. Otherwise you will always get 'all'.

Example:

 use SDL;
  use SDL::Video;
@@ -293,9 +301,9 @@ or it return undef if no modes are available.

if($#modes > 0) { print("available modes:\n"); - foreach my $index ( @modes ) + foreach my $mode ( @modes ) { - printf("%03d: %d x %d\n", $index, $modes[$index]->w, $modes[$index]->h ); + printf("%d x %d\n", $mode->w, $mode->h ); } } elsif($#modes == 0)