18.12Class SDLScreen

Screen oriented SDL surface.

Class SDLScreen from \
                 SDLSurface( )

This class is a specialization of the SDLSurface class, providing methods meant to be used only on surfaces that should refer to SDL graphic devices.

Methods
FlipFlips screen buffers.
SetPaletteChanges part of the palette of a palettized surface.
ToggleFullScreenToggles the application between windowed and fullscreen mode
UpdateRectRefreshes an SDL screen surface or a part of it.
UpdateRectsUpdates one or more areas of the screen at the same time.
Properties inherited from class SDLSurface
bpp Shortcut to access format.
clip_rect An object of class holding the clip rectangle (read only)
flagsSDL flags for this surface.
format instance describing the pixels in this surface.
h Height of the surface.
pitch Bytes per line; see remarks on .
pixelsMemBuf storage for pixels of this surface.
w Width of the surface.
Methods inherited from class SDLSurface
BlitSurfaceCopies a surface of part of it onto another surface.
DisplayFormatAlphaEnables this surface to work with source alpha transparency.
FillRectFills a rectangle with a given color.
GetPixelGet a single pixel value from the surface
GetPixelIndexReturn the index of a pixel in the pixels array of this class
GetRGBADecomposes a given pixel value to RGBA values.
IsLockNeededTells wether locks are needed on this surface or not.
LockIfNeededLocks a surface for deep binary access only if needed.
LockSurfaceLocks the surface for low level byte access.
MapRGBABuilds a color value from RGBA values.
SaveBMPSaves a BMP files to disk.
SetAlphaSets the ALPHA settings for this surface
SetColorsChanges part of the color map of a palettized surface.
SetIconSets this surface as the icon for the SDL window.
SetPixelSets a single pixel to desired value
UnlockIfNeededUnlocks a surface for deep binary access only if needed.
UnlockSurfaceUnlocks the surface.

Methods

Flip

Flips screen buffers.

SDLScreen.Flip()

It delivers to the screen the paint buffer, be it software or hardware.

SetPalette

Changes part of the palette of a palettized surface.

SDLScreen.SetPalette( flags, colors, firstColor )
flags Selector of logical or physical palette (or both).
colors A 4 bytes per entry MemBuf containing the color data.
firstColor An integer specifying the first color of the palette.
Returntrue if the palette could be changed, 0 if the image has no palette or if the color map was too wide to fit the image palette.

The colors in the MemBuf are stored with red, green, blue stored respectively at smallest, medium and highest address (regardless of endianity). In other words, the first 8 bits of the color number are the red value, the next 8 bits are the green value and the next 8 bits are blue.

Flags can be one of the following values; if both the palettes (logical and physical) must be updated, the two flags can be combined through OR operator.

- SDL.LOGPAL - updates the logical palette

ToggleFullScreen

Toggles the application between windowed and fullscreen mode

SDLScreen.ToggleFullScreen()
Raise
SDLError if not supported.

Toggles the application between windowed and fullscreen mode, if supported.

UpdateRect

Refreshes an SDL screen surface or a part of it.

SDLScreen.UpdateRect( [xOrRect],[y],[width],[height] )
xOrRect an X coordinate or a SDLRect containing refresh coordinates.
y coordinate of the refresh rectangle.
width width of the refresh rectangle.
height height of the refresh rectangle.

If no parameter is specified, the whole screen is refreshed. A refresh area can be specified either passing a single SDLRect instance as parameter or specifying the four coordinates as numbers.

UpdateRects

Updates one or more areas of the screen at the same time.

SDLScreen.UpdateRects( aRects )
aRects Array of SDLRect instances that have to be updated.

This method should not be called while helding the lock of the screen surface.

Made with http://www.falconpl.org