X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Video.html-inc;h=c6a2ac43311d0582e250d729905e22113afd3c44;hb=879e3e79b8b6ee9bf4b30a60a2e7bef40ad46c2d;hp=2339927fc1d363486237346f2cdd71c8661fcc3d;hpb=260482f9a6bd51b880213756521fed96ded669d8;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Video.html-inc b/pages/SDL-Video.html-inc index 2339927..c6a2ac4 100644 --- a/pages/SDL-Video.html-inc +++ b/pages/SDL-Video.html-inc @@ -9,70 +9,70 @@
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
+SDL::Video::set_video_mode, the vfmt
member of the returned structure will contain the pixel
format of the best video mode.
Example:
use SDL; @@ -192,8 +192,8 @@ word identifier like"x11"
,"windib" -
list_modes(formats,flags)
-+list_modes
+-my @modes = @{ SDL::Video::list_modes( $pixel_format, $flags ) };@@ -230,13 +230,13 @@ or it return undef if no modes are available.video_mode_ok(width,height,bpp,flags)
-+video_mode_ok
+-my $bpp_ok = SDL::Video::video_mode_ok( $width, $height, $bpp, $flags );This function is used to check whether the requested mode is supported by the current video device. The arguments passed to this function -are the same as those you would pass to SDL::Video::set_video_mode. +are the same as those you would pass to SDL::Video::set_video_mode. It returns
0
if the mode is not supported at all, otherwise the suggestedbpp
.Example:
use SDL; @@ -256,8 +256,8 @@ It returns0
if the mode is not supported at all, otherwise the sugset_video_mode(width,height,bpp,flags)
-+set_video_mode
+-my $surface = SDL::Video::set_video_mode( 800, 600, 32, SDL_SWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN);@@ -293,11 +293,11 @@ PassingSDL_ANYFORMAT
prevents this and causes SDL to use the videoSDL_DOUBLEBUF
- Enable hardware double buffering; only valid with
SDL_HWSURFACE
. Calling SDL::Video::flip will flip the buffers and update +Enable hardware double buffering; only valid with
+If double buffering could not be enabled then SDL::Video::flip will just perform a +SDL::Video::update_rect on the entire screen.SDL_HWSURFACE
. Calling SDL::Video::flip will flip the buffers and update the screen. All drawing will take place on the surface that is not displayed at the moment. -If double buffering could not be enabled then SDL::Video::flip will just perform a -SDL::Video::update_rect on the entire screen.SDL_FULLSCREEN
@@ -307,7 +307,7 @@ the next higher resolution will be used and the display window centered on a bla SDL_OPENGL
Create an OpenGL rendering context. You should have previously set OpenGL video attributes with -SDL::Video::GL_set_attribute.
+SDL::Video::GL_set_attribute.SDL_OPENGLBLIT
@@ -319,7 +319,7 @@ NOTE: This option is kept for compatibility only, and will be removed in next ve Create a resizable window. When the window is resized by the user a
+SDL::Video::set_video_mode can be called again with the new size.SDL_VIDEORESIZE
event is generated and -SDL::Video::set_video_mode can be called again with the new size.SDL_NOFRAME
@@ -340,21 +340,21 @@ been set causes the application to simply ignore those attributes, while enablin User note 2: Also note that, in Windows, setting the video mode resets the current OpenGL context. You must execute again the OpenGL initialization code (set the clear color or the shade model, or reload textures, for example) after calling SDL::set_video_mode. In Linux, however, it works fine, and the initialization code only needs to be executed after the first call to -SDL::Video::set_video_mode (although there is no harm in executing the initialization code after -each call to SDL::Video::set_video_mode, for example for a multiplatform application).
+SDL::Video::set_video_mode (although there is no harm in executing the initialization code after +each call to SDL::Video::set_video_mode, for example for a multiplatform application).convert_surface(surface,format,flags)
-+-convert_surface
+$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. It is also useful for making a copy of a surface.
-The flags parameter is passed to
SDL::Surface->new()
and has those semantics. -This function is used internally bySDL::Video::display_format
. +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 afterSDL::init
.it returns a
+SDL::Surface
on success orundef
on error.it returns a SDL::Surface on success or
undef
on error.display_format
@@ -363,7 +363,7 @@ This function can only be called afterSDL::init
.This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer, suitable for fast -blitting onto the display surface. It calls
+blitting onto the display surface. It calls SDL::Video::convert_surface.SDL::Video::convert_surface
.If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function.
If you want an alpha channel, see
SDL::Video::display_format_alpha
. @@ -377,21 +377,22 @@ Return ValueThis function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer plus an alpha channel, -suitable for fast blitting onto the display surface. It calls
+suitable for fast blitting onto the display surface. It calls SDL::Video::convert_surface.SDL::Video::convert_surface
.If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function.
This function can be used to convert a colorkey to an alpha channel, if the
-SDL_SRCCOLORKEY
flag is set on the surface. The generated surface will then be transparent (alpha=0) where the pixels match the colorkey, and opaque (alpha=255) elsewhere.Note: The video surface must be initialised using
+SDL::Video::set_video_mode
before this function is called, or it will segfault.Note: The video surface must be initialised using SDL::Video::set_video_mode before this function is called, or it will +segfault.
load_BMP(filename)
-+load_BMP
+-$surface = SDL::Video::load_BMP( $filename );-Loads a
+SDL::Surface
from a named Windows BMP file. -SDL::Video::load_BMP
returns aSDL::Surface
on success orundef
on error.Loads a SDL::Surface from a named Windows BMP file. +
SDL::Video::load_BMP
returns a SDL::Surface on success orundef
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; @@ -423,34 +424,34 @@ surface will then be transparent (alpha=0) where the pixels match the colorkey,save_BMP(surface,filename)
-+save_BMP
+-$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.
set_color_key(surface,flag,key)
-+set_color_key
+-$set_color_key = SDL::Video::set_color_key( $surface, $flag, $key );Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration.
RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the key value). -The key must be of the same pixel format as the surface,
SDL::Video::map_RGB
is often useful for obtaining an acceptable value. +The key must be of the same pixel format as the surface, SDL::Video::map_RGB is often useful for obtaining an acceptable value. If flag isSDL_SRCCOLORKEY
then key is the transparent pixel value in the source image of a blit.If
flag
is OR'd withSDL_RLEACCEL
then the surface will be drawn using RLE acceleration when drawn with SDL::Blit_surface. -The surface will actually be encoded for RLE acceleration the first timeSDL::Video::blit_surface
orSDL::Video::display_format
-is called on the surface. +The surface will actually be encoded for RLE acceleration the first time SDL::Video::blit_surface or +SDL::Video::display_format|/display_format
is called on the surface. Ifflag
is0
, this function clears any current color key.
SDL::Video::set_color_key
returns0
on success or-1
on error.set_alpha(surface,flag,key)
-+set_alpha
+-$set_alpha = SDL::Video::set_alpha( $surface, $flag, $key );@@ -465,43 +466,43 @@ still be accelerated withSDL_RLEACCEL
.Note: The per-surface alpha value of 128 is considered a special case and is optimised, so it's much faster than other per-surface values.
Alpha affects surface blitting in the following ways:
-
- RGBA->RGB with SDL_SRCALPHA
+- RGBA->RGB with
SDL_SRCALPHA
- -
The source is alpha-blended with the destination, using the alpha channel. SDL_SRCCOLORKEY and the per-surface alpha are ignored.
- RGBA->RGB without SDL_SRCALPHA
+- RGBA->RGB without
SDL_SRCALPHA
- -
The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
- RGB->RGBA with SDL_SRCALPHA
+- RGB->RGBA with
SDL_SRCALPHA
- -
The source is alpha-blended with the destination using the per-surface alpha value. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied. The alpha channel of the copied pixels is set to opaque.
- RGB->RGBA without SDL_SRCALPHA
+- RGB->RGBA without
SDL_SRCALPHA
- -
The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
- RGBA->RGBA with SDL_SRCALPHA
+- RGBA->RGBA with
SDL_SRCALPHA
- -
The source is alpha-blended with the destination using the source alpha channel. The alpha channel in the destination surface is left untouched. SDL_SRCCOLORKEY is ignored.
- RGBA->RGBA without SDL_SRCALPHA
+- RGBA->RGBA without
SDL_SRCALPHA
- -
The RGBA data is copied to the destination surface. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
- RGB->RGB with SDL_SRCALPHA
+- RGB->RGB with
SDL_SRCALPHA
- -
The source is alpha-blended with the destination using the per-surface alpha value. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
- RGB->RGB without SDL_SRCALPHA
+- RGB->RGB without
SDL_SRCALPHA
The RGB data is copied from the source. If SDL_SRCCOLORKEY is set, only the pixels not matching the colorkey value are copied.
@@ -514,38 +515,39 @@ two arbitrary RGBA surfaces this way and get the result you would expect from &q
SDL::Video::set_alpha
returns0
on success or-1
on error.fill_rect(dest,dest_rect,pixel)
-+fill_rect
+-$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 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
orSDL::Video::map_RGBA
-functions. If the color value contains an alpha value then the destination is simply "filled" with that alpha information, no blending takes -place.If there is a clip rectangle set on the destination (set via
-SDL::Video::set_clip_rect
), then this function will clip based on the -intersection of the clip rectangle and the dstrect rectangle, and the dstrect rectangle will be modified to represent the area actually filled.If you call this on the video surface (ie: the value of
+SDL::Video::get_video_surface
) you may have to update the video surface to see the -result. This can happen if you are using a shadowed surface that is not double buffered in Windows XP using build 1.2.9.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 +alpha information, no blending takes place.If there is a clip rectangle set on the destination (set via SDL::Video::set_clip_rect), then this function will clip based +on the intersection of the clip rectangle and the dstrect rectangle, and the dstrect rectangle will be modified to represent the area actually +filled.
+If you call this on the video surface (ie: the value of SDL::Video::get_video_surface) you may have to update the video +surface to see the result. This can happen if you are using a shadowed surface that is not double buffered in Windows XP using build 1.2.9.
SDL::Video::fill_rect
returns0
on success or-1
on error.for an example see SYNOPSIS.
Surface locking and unlocking
-+Surface Locking and Unlocking
+-lock_surface(surface)
-+lock_surface
+-int SDL::Video::lock_surface( $surface );-
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 insurface-
format>. -Once you are done accessing the surface, you should useSDL::Video::unlock_surface
to release the lock.Not all surfaces require locking. If
+SDL::Video::MUSTLOCK(surface)
evaluates to0
, then reading and writing pixels to the surface can +Once you are done accessing the surface, you should use SDL::Video::unlock_surface to release the lock.Not all surfaces require locking. If SDL::Video::MUSTLOCK evaluates to
@@ -630,19 +632,19 @@ a matching unlock.0
, then reading and writing pixels to the surface can be performed at any time, and the pixel format of the surface will not change. No operating system or library calls should be made between the lock/unlock pairs, as critical system locks may be held during this time.SDL::Video::lock_surface
returns0
on success or-1
on error.unlock_surface(surface)
--void SDL::Video::unlock_surface( $surface ); +unlock_surface
++-SDL::Video::unlock_surface( $surface );-Surfaces that were previously locked using
SDL::Video::lock_surface
must be unlocked withSDL::Video::unlock_surface
. Surfaces should -be unlocked as soon as possible. +Surfaces that were previously locked using SDL::Video::lock_surface must be unlocked with
-SDL::Video::unlock_surface
. +Surfaces should be unlocked as soon as possible.SDL::Video::unlock_surface
doesn't return anything.Note: Since 1.1.8, the surface locks are recursive. See
+SDL::Video::lock_surface
for more information.Note: Since 1.1.8, the surface locks are recursive. See SDL::Video::lock_surface for more information.
MUSTLOCK(surface)
-+MUSTLOCK
+int SDL::Video::MUSTLOCK( $surface );@@ -653,8 +655,8 @@ be unlocked as soon as possible.-set_clip_rect(surface,rect)
-+set_clip_rect
+-SDL::Video::set_clip_rect( $surface, $rect );@@ -666,8 +668,8 @@ If rect is NULL the clipping rectangle will be set to the full size of the surfaSDL::Video::set_clip_rect
doesn't returns anything.get_clip_rect(surface,rect)
-+get_clip_rect
+-SDL::Video::get_clip_rect( $surface, $rect );@@ -698,8 +700,8 @@ The rectangle pointed to by rect will be filled with the clipping rectangle of tblit_surface(src,src_rect,dest,dest_rect)
-+blit_surface
+-SDL::Video::blit_surface( $src_surface, $src_rect, $dest_surface, $dest_rect );@@ -711,34 +713,34 @@ The final blit rectangle is saved indst_rect
after all clipping is The blit function should not be called on a locked surface. I.e. when you use your own drawing functions you may need to lock a surface, but this is not the case withSDL::Video::blit_surface
. Like most surface manipulation functions in SDL, it should not be used together with OpenGL. -The results of blitting operations vary greatly depending on whether
SDL_SRCALPHA
is set or not. SeeSDL::Video::set_alpha
for an -explanation of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting. +The results of blitting operations vary greatly depending on whether
-SDL_SRCALPHA
is set or not. See SDL::Video::set_alpha +for an explanation of how this affects your results. Colorkeying and alpha attributes also interact with surface blitting.SDL::Video::blit_surface
doesn't returns anything.For an example see load_BMP.
+For an example see SDL::Video::load_BMP.
update_rect(surface,x,y,width,height)
-+update_rect
+-update_rect( $surface, $left, $top, $width, $height );Makes sure the given area is updated on the given screen. The rectangle must be confined within the screen boundaries because there's no clipping. update_rect doesn't returns any value.
-Note: This function should not be called while screen is locked by SDL::Video::lock_surface
+Note: This function should not be called while screen is locked by SDL::Video::lock_surface
Note2: If
x
,y
,width
andheight
are all equal to 0,update_rect
will update the entire screen.For an example see SYNOPSIS
update_rects(surface,rects)
-+update_rects
+-update_rects( $surface, @rects );Makes sure the given list of rectangles is updated on the given screen. The rectangle must be confined within the screen boundaries because there's no clipping.
-update_rects
doesn't returns any value.Note: This function should not be called while screen is locked by SDL::Video::lock_surface.
+Note: This function should not be called while screen is locked by SDL::Video::lock_surface.
Example:
use SDL; use SDL::Video; @@ -774,8 +776,8 @@ The rectangle must be confined within the screen boundaries because there's no cflip(surface)
-+flip
+$flip = SDL::Video::flip( $screen_surface );@@ -786,10 +788,11 @@ On hardware that doesn't support double-buffering or ifSDL_SWSURFACEA software screen surface is also updated automatically when parts of a SDL window are redrawn, caused by overlapping windows or by restoring from an iconified state. As a result there is no proper double buffer behavior in windowed mode for a software screen, in contrast to a full screen software mode. -
The
+SDL_DOUBLEBUF
flag must have been passed toSDL::Video::set_video_mode
, when setting the video mode for this function to -perform hardware flipping.The
SDL_DOUBLEBUF
flag must have been passed to SDL::Video::set_video_mode, when setting the video mode for this function +to perform hardware flipping.-
flip
returns0
on success or-1
on error.Note: If you want to swap the buffers of an initialized OpenGL context, use the function
+SDL::Video::GL_swap_buffers
instead.Note: If you want to swap the buffers of an initialized OpenGL context, use the function SDL::Video::GL_swap_buffers +instead.
Example:
use SDL; use SDL::Video; @@ -821,49 +824,49 @@ perform hardware flipping.-set_colors(surface,start,colors)
-+set_colors
+-$set_colors = SDL::Video::set_colors( $surface, $start, $color1, $color2, ... )Sets a portion of the colormap for the given 8-bit surface.
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 inSDL::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. +IfSDL_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. Palettized (8-bit) screen surfaces with theSDL_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 callingSDL::Video::set_palette
with the flags set to -(SDL_LOGPAL | SDL_PHYSPAL
).SDL::Video::set_colors
modifies both palettes (if present), and is equivalent to calling SDL::Video::set_palette with the +flags set to (SDL_LOGPAL | SDL_PHYSPAL
).If
surface
is not a palettized surface, this function does nothing, returning 0. If all of the colors were set as passed toSDL::Video::set_colors
, it will return 1. If not all the color entries were set exactly as given, it will return 0, and you should look at the surface palette to determine the actual color palette.set_palette(surface,flags,start,colors)
-+set_palette
+-$set_palette = set_palette( $surface, $flags, $start, $color1, $color2, ... );Sets a portion of the palette for the given 8-bit surface.
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). -Non screen surfaces have a logical palette only.SDL::Video::blit
always uses the logical palette when blitting surfaces (if it has to +Non screen surfaces have a logical palette only. SDL::Video::blit always uses the logical palette when blitting surfaces (if it has to convert between surface pixel formats). Because of this, it is often useful to modify only one or the other palette to achieve various special color effects (e.g., screen fading, color flashes, screen dimming).This function can modify either the logical or physical palette by specifying
SDL_LOGPAL
orSDL_PHYSPAL
the in the flags parameter.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 inSDL::Video::set_video_mode
flags,SDL::Video::set_palette
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. +IfSDL_HWPALETTE
was set in SDL::Video::set_video_mode flags,SDL::Video::set_palette
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 aSDL::Color
structure are 8-bits in size, giving you a total of 2563 = 16777216 colors.If
surface
is not a palettized surface, this function does nothing, returning0
. If all of the colors were set as passed toset_palette
, it will return1
. If not all the color entries were set exactly as given, it will return0
, and you should look at the surface palette to determine the actual color palette.set_gamma(r,g,b)
-+set_gamma
+-$set_gamma = SDL::Video::set_gamma( $red_gamma, $green_gamma, $blue_gamma );@@ -922,8 +925,8 @@ with SDL::set_gamma_ramp.get_gamma_ramp(rt,gt,bt)
-+get_gamma_ramp
+-$get_gamma_ramp = SDL::Video::get_gamma_ramp( \@red_table, \@green_table, \@blue_table );@@ -954,8 +957,8 @@ with SDL::set_gamma_ramp.set_gamma_ramp(rt,gt,bt)
-+set_gamma_ramp
+-$set_gamma_ramp = SDL::Video::set_gamma_ramp( \@red_table, \@green_table, \@blue_table );@@ -964,7 +967,7 @@ mapping between the input and output for that channel. The input is the index into the array, and the output is the 16-bit gamma value at that index, scaled to the output color precision. You may pass NULL to any of the channels to leave them unchanged.This function adjusts the gamma based on lookup tables, you can also have the gamma calculated based on a "gamma function" parameter -with
+with SDL::Video::set_gamma.SDL::Video::set_gamma
.Not all display hardware is able to change gamma.
SDL::Video::set_gamma_ramp
returns-1
on error (or if gamma adjustment is not supported).Example:
@@ -999,8 +1002,8 @@ withSDL::Video::set_gamma
.map_RGB(pixel_format,r,g,b)
-+map_RGB
+-$pixel = SDL::Video::map_RGB( $pixel_format, $r, $g, $b );@@ -1041,8 +1044,8 @@ If the SDL::PixelFormat's bpp (color depth)map_RGBA(pixel_format,r,g,b,a)
-+map_RGBA
+-$pixel = SDL::Video::map_RGB( $pixel_format, $r, $g, $b, $a );@@ -1054,19 +1057,19 @@ If the pixel format bpp (color depth) is less than 32-bpp then the unused upper with a 16-bpp format the return value can be assigned to a Uint16, and similarly a Uint8 for an 8-bpp format).get_RGB(pixel_format,pixel)
-+get_RGB
+-$rgb_array_ref = SDL::Video::get_RGB( $pixel_format, $pixel );Returns RGB values from a pixel in the specified pixel format. The pixel is an integer (e.g. 16bit RGB565, 24/32bit RGB888). This function uses the entire 8-bit [0..255] range when converting color components from pixel formats with less than 8-bits per RGB component (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
-For an example see
+SDL::Video::map_RGB
.For an example see SDL::Video::map_RGB.
get_RGBA(pixel_format,pixel)
-+get_RGBA
+$rgba_array_ref = SDL::Video::get_RGBA( $pixel_format, $pixel );@@ -1080,29 +1083,26 @@ component (e.g., a completely white pixel in 16-bit RGB565 format would return [-GL_load_library(path)
-+GL_load_library
+-$gl_load_lib = SDL::Video::GL_load_library( 'path/to/static/glfunctions.dll' );-If you wish, you may load the OpenGL library from the given path at runtime, this must be done before
+SDL::Video::set_video_mode
is called. -You must then useSDL::Video::GL_get_proc_address
to retrieve function pointers to GL functions.If you wish, you may load the OpenGL library from the given path at runtime, this must be done before +SDL::Video::set_video_mode is called. You must then use SDL::Video::GL_get_proc_address to retrieve +function pointers to GL functions.
GL_load_library
returns0
on success or-1
or error.GL_get_proc_address(proc)
-- - - - - - +GL_get_proc_address
++-$proc_address = SDL::Video::GL_get_proc_address( $proc ); +Returns the address of the GL function proc, or NULL if the function is not found. If the GL library is loaded at runtime, with -
+SDL::Video::GL_load_library, then all GL functions must be retrieved this way. Usually this is used to retrieve function +pointers to OpenGL extensions. Note that this function needs an OpenGL context to function properly, so it should be called after +SDL::Video::set_video_mode has been called (with theSDL::Video::GL_load_library
, then all GL functions must be retrieved this way. Usually this is used to retrieve function pointers to OpenGL -extensions. Note that this function needs an OpenGL context to function properly, so it should be called afterSDL::Video::set_video_mode
-has been called (with theSDL_OPENGL
flag).SDL_OPENGL
flag).It returns undef if the function is not found.
Example:
my $has_multitexture = 1; @@ -1122,29 +1122,29 @@ has been called (with theSDL_OPENGL
flag).GL_get_attribute(attr)
-+GL_get_attribute
+-$value = SDL::Video::GL_get_attribute( $attr );-It returns SDL/OpenGL attribute
+attr
. This is useful after a call toSDL::Video::set_video_mode
to check whether your attributes have -been set as you expected. -SDL::Video::GL_get_attribute
returns undef if the attribute is not found.It returns SDL/OpenGL attribute
attr
. This is useful after a call to SDL::Video::set_video_mode to check whether your +attributes have been set as you expected. +SDL::Video::GL_get_attribute
returnsundef
if the attribute is not found.Example:
print( SDL::Video::GL_set_attribute(SDL_GL_RED_SIZE) );GL_set_attribute(attr,value)
-+GL_set_attribute
+-$set_attr = SDL::Video::GL_set_attribute( $attr, $value );This function sets the given OpenGL attribute
+SDL::Video::set_video_mode. +You should useattr
tovalue
. The requested attributes will take effect after a call to -SDL::Video::set_video_mode
. -You should useGL_get_attribute
to check the values after aset_video_mode
call, since the values obtained can differ from the -requested ones.SDL::Video::GL_get_attribute|/GL_get_attribute
to check the values after a SDL::Video::set_video_mode call, +since the values obtained can differ from the requested ones.Available attributes:
- @@ -1189,30 +1189,30 @@ or disabled using the
SDL_GL_RED_SIZE
SDL_GL_DOUBLEBUFFER
attribute.see SDL::Overlay
lock_YUV_overlay(overlay)
-+lock_YUV_overlay
+-$lock_overlay = SDL::Video::lock_YUV_overlay( $overlay );-Much the same as
SDL::Video::lock_surface
,lock_YUV_overlay
locks the overlay for direct access to pixel data. +Much the same as SDL::Video::lock_surface,
lock_YUV_overlay
locks the overlay for direct access to pixel data. It returns0
on success or-1
on error.unlock_YUV_overlay(overlay)
-+unlock_YUV_overlay
+-SDL::Video::unlock_YUV_overlay( $overlay );-The opposite to
+SDL::Video::lock_YUV_overlay
. Unlocks a previously locked overlay. An overlay must be unlocked before it can be displayed. -unlock_YUV_overlay
does not return anything.The opposite to SDL::Video::lock_YUV_overlay. Unlocks a previously locked overlay. An overlay must be unlocked before it +can be displayed.
unlock_YUV_overlay
does not return anything.display_YUV_overlay(overlay,dstrect)
-+display_YUV_overlay
+$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. Thex
andy
fields ofdstrect
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 isoptimized
for 2x scalingIt returns
@@ -1222,8 +1222,8 @@ The overlay is scaled (independently in x and y dimensions) to the size specifie0
on success or-1
on error.-wm_set_caption(title,icon)
-