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 | |
Flip | Flips screen buffers. |
SetPalette | Changes part of the palette of a palettized surface. |
ToggleFullScreen | Toggles the application between windowed and fullscreen mode |
UpdateRect | Refreshes an SDL screen surface or a part of it. |
UpdateRects | Updates 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) |
flags | SDL flags for this surface. |
format | instance describing the pixels in this surface. |
h | Height of the surface. |
pitch | Bytes per line; see remarks on . |
pixels | MemBuf storage for pixels of this surface. |
w | Width of the surface. |
Methods inherited from class SDLSurface | |
BlitSurface | Copies a surface of part of it onto another surface. |
DisplayFormatAlpha | Enables this surface to work with source alpha transparency. |
FillRect | Fills a rectangle with a given color. |
GetPixel | Get a single pixel value from the surface |
GetPixelIndex | Return the index of a pixel in the pixels array of this class |
GetRGBA | Decomposes a given pixel value to RGBA values. |
IsLockNeeded | Tells wether locks are needed on this surface or not. |
LockIfNeeded | Locks a surface for deep binary access only if needed. |
LockSurface | Locks the surface for low level byte access. |
MapRGBA | Builds a color value from RGBA values. |
SaveBMP | Saves a BMP files to disk. |
SetAlpha | Sets the ALPHA settings for this surface |
SetColors | Changes part of the color map of a palettized surface. |
SetIcon | Sets this surface as the icon for the SDL window. |
SetPixel | Sets a single pixel to desired value |
UnlockIfNeeded | Unlocks a surface for deep binary access only if needed. |
UnlockSurface | Unlocks the surface. |
Flips screen buffers.
SDLScreen.Flip()
It delivers to the screen the paint buffer, be it software or hardware.
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. |
Return | true 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
Toggles the application between windowed and fullscreen mode
SDLScreen.ToggleFullScreen()
Raise |
|
Toggles the application between windowed and fullscreen mode, if supported.
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.
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.