X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Video.html-inc;h=86b96b89bbe5f764720e232ca9e2273c4bd424f6;hb=5ce48b7ebb54cf63bf5fb7ffb7d5f9213f8d45a9;hp=d1de82186f9c8911ebf626e2c94fdf5d425caa42;hpb=5da5649767979ede6f91b014e6f9e2d7dc729739;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Video.html-inc b/pages/SDL-Video.html-inc index d1de821..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 ':flags';
+
 use SDL;
+ use SDL::Video;
  use SDL::Surface;
  use SDL::Rect;
 
@@ -129,72 +129,79 @@
 

CONSTANTS

Top

-

Available flags for SDL::Video::set_video_mode:

-
-
SDL_ANYFORMAT
-
-

Allow any pixel-format *

-
-
SDL_HWPALETTE
-
-

Have an exclusive palette

-
-
SDL_DOUBLEBUF
-
-

Double buffered *

-
-
SDL_FULLSCREEN
-
-

Full screen surface *

-
-
SDL_OPENGL
-
-

Have an OpenGL context *

-
-
SDL_OPENGLBLIT
-
-

Support OpenGL blitting *. NOTE: This option is kept for compatibility only, and is not recommended for new code.

-
-
SDL_RESIZABLE
-
-

Resizable surface *

-
-
SDL_NOFRAME
-
-

No window caption or edge frame

-
-
-

Used internally

-
-
SDL_HWACCEL
-
-

Use hardware acceleration blit

-
-
SDL_SRCCOLORKEY
-
-

Use colorkey blitting

-
-
SDL_RLEACCELOK
-
-

Private flag

-
-
SDL_RLEACCEL
-
-

Accelerated colorkey blitting with RLE

-
-
SDL_SRCALPHA
-
-

Use alpha blending blit

-
-
SDL_PREALLOC
-
-

Use preallocated memory

-
-
- - - +

The constants are exported by default. You can avoid this by doing:

+
 use SDL::Video ();
+
+
+

and access them directly:

+
 SDL::Video::SDL_SWSURFACE;
+
+
+

or by choosing the export tags below:

+

Export tag: ':surface'

+
 SDL_ASYNCBLIT       Use asynchronous blit if possible
+ SDL_SWSURFACE       Stored in the system memory.
+ SDL_HWSURFACE       Stored in video memory
+
+
+

Export tag: ':video'

+
 SDL_ANYFORMAT       Allow any pixel-format
+ SDL_HWPALETTE       Have an exclusive palette
+ SDL_DOUBLEBUF       Double buffered
+ SDL_FULLSCREEN      Full screen surface
+ SDL_OPENGL          Have an OpenGL context
+ SDL_OPENGLBLIT      Support OpenGL blitting. 
+                     NOTE: This option is kept for compatibility only, and is not recommended for new code.
+ SDL_RESIZABLE       Resizable surface
+ SDL_NOFRAME         No window caption or edge frame
+ SDL_HWACCEL Use     Hardware acceleration blit
+ SDL_SRCCOLORKEY     Use colorkey blitting
+ SDL_RLEACCELOK      Private flag
+ SDL_RLEACCEL        Accelerated colorkey blitting with RLE
+ SDL_SRCALPHA        Use alpha blending blit
+ SDL_PREALLOC        Use preallocated memory
+
+
+

Export tag ':overlay'

+
 SDL_YV12_OVERLAY    Planar mode: Y + V + U  (3 planes)
+ SDL_IYUV_OVERLAY    Planar mode: Y + U + V  (3 planes)
+ SDL_YUY2_OVERLAY    Packed mode: Y0+U0+Y1+V0 (1 plane)
+ SDL_UYVY_OVERLAY    Packed mode: U0+Y0+V0+Y1 (1 plane)
+ SDL_YVYU_OVERLAY    Packed mode: Y0+V0+Y1+U0 (1 plane)
+
+
+

Export tag ':palette'

+
 SDL_LOGPAL          Logical palette, which controls how blits are mapped to/from the surface
+ SDL_PHYSPAL         Physical palette, which controls how pixels look on the screen
+
+
+

Export tag ':grab'

+
 SDL_GRAB_QUERY
+ SDL_GRAB_OFF
+ SDL_GRAB_ON
+ SDL_GRAB_FULLSCREEN Used interally
+
+
+

Export tag ':gl'

+
 SDL_GL_RED_SIZE
+ SDL_GL_GREEN_SIZE
+ SDL_GL_BLUE_SIZE
+ SDL_GL_ALPHA_SIZE
+ SDL_GL_BUFFER_SIZE
+ SDL_GL_DOUBLEBUFFER
+ SDL_GL_DEPTH_SIZE
+ SDL_GL_STENCIL_SIZE
+ SDL_GL_ACCUM_RED_SIZE
+ SDL_GL_ACCUM_GREEN_SIZE
+ SDL_GL_ACCUM_BLUE_SIZE
+ SDL_GL_ACCUM_ALPHA_SIZE
+ SDL_GL_STEREO
+ SDL_GL_MULTISAMPLEBUFFERS
+ SDL_GL_MULTISAMPLESAMPLES
+ SDL_GL_ACCELERATED_VISUAL
+ SDL_GL_SWAP_CONTROL
 
+

Core Functions

Top

@@ -268,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;
@@ -286,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)