|
NAMESDLmm::BaseSurface - An abstract base class for graphical surfaces.SYNOPSIS#include <sdlmm_basesurface.h> Inherited by SDLmm::Display, and SDLmm::Surface. Public Methodsvirtual ~BaseSurface () The destructor. SDL_Surface* GetSurface () const SDL_Surface* GetSurface () const bool Lock () Lock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise. void Unlock () Unlock the surface. void SetPixel (int x, int y, Color color) Set the pixel to the color. void SetPixel1 (int x, int y, Color color) Set the pixel to the color. void SetPixel2 (int x, int y, Color color) Set the pixel to the color. void SetPixel3 (int x, int y, Color color) Set the pixel to the color. void SetPixel4 (int x, int y, Color color) Set the pixel to the color. void SetPixel (const SRect &point, Color color) Set the pixel to the color. Color GetPixel (int x, int y) const Get the color of the pixel. Color GetPixel (const SRect &point) const Get the color of the pixel. bool SetColorKey (Uint32 flag, Color key) Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration. bool SetAlpha (Uint32 flag, Uint8 alpha) Adjust the alpha properties of this surface. virtual bool SetDisplayFormat ()=0 Convert the surface to the display format. virtual bool SetDisplayFormatAlpha ()=0 Convert the surface to the display format. bool SaveBMP (const char *file) const Save a BaseSurface object as a Windows bitmap file. bool SaveBMP (const std::string &file) const Save a BaseSurface object as a Windows bitmap file. Informational methods
Clipping Methods
Blitting / Filling
Protected Methodsvirtual void SetSurface (SDL_Surface *surface) BaseSurface (SDL_Surface *surface) Constructor from an SDL_Surface*. BaseSurface (const BaseSurface &other) BaseSurface& operator= (const BaseSurface &other) Protected AttributesSDL_Surface* me The actual SDL_Surface allocated for this BaseSurface. DETAILED DESCRIPTIONAn abstract base class for graphical surfaces.Surfaces represent areas of 'graphical' memory, memory that can be drawn to. The video framebuffer is returned as a VideoSurface by SetVideoMode() and GetVideoSurface(). Ordinary (non-framebuffer surfaces) are represented by a Surface. The clipping rectangle returned by clip_rect() can be set with SetClipRect() method. Author:
CONSTRUCTOR & DESTRUCTOR DOCUMENTATIONSDLmm::BaseSurface::BaseSurface (SDL_Surface * surface) [inline, explicit, protected]Constructor from an SDL_Surface*.This creates a new BaseSurface object from an existing SDL_Surface. Note that ownership of the SDL_Surface is passed on to the BaseSurface. It's very important not to free the original surface since that will cause a problem when the object is destructed (SDL_Surface storage freed twice). Use with caution. SDLmm::BaseSurface::BaseSurface (const BaseSurface & other) [inline, protected]SDLmm::BaseSurface::~BaseSurface () [inline, virtual]The destructor.MEMBER FUNCTION DOCUMENTATIONint SDLmm::BaseSurface::Blit (const BaseSurface & src, const SDL_Rect & srcrect, const SPoint & dstpoint)Fast blit the specified area part of the source surface onto this surface at the specified coordinates.The choosen rectangle of the source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. Returns:
Parameters:
int SDLmm::BaseSurface::Blit (const BaseSurface & src, const SDL_Rect & srcrect, const SPoint & dstpoint, SDL_Rect & dstrect) [inline]Fast blit the specified area part of the source surface onto this surface at the specified coordinates.The choosen rectangle of the source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed (srcrect is not modified). Returns:
Parameters:
int SDLmm::BaseSurface::Blit (const BaseSurface & src, const SDL_Rect & srcrect, SDL_Rect & dstrect)Fast blit the specified area part of the source surface onto this surface at the specified coordinates.The choosen rectangle of the source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed (srcrect is not modified). Returns:
Parameters:
int SDLmm::BaseSurface::Blit (const BaseSurface & src, const SPoint & dstpoint)Fast blit the entire source surface onto this surface at the specified coordinates.The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. Returns:
Parameters:
int SDLmm::BaseSurface::Blit (const BaseSurface & src, const SPoint & dstpoint, SDL_Rect & dstrect) [inline]Fast blit the entire source surface onto this surface at the specified coordinates.The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed. Returns:
Parameters:
int SDLmm::BaseSurface::Blit (const BaseSurface & src, SDL_Rect & dstrect)Fast blit the entire source surface onto this surface at the specified coordinates.The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. The final blit rectangle is saved in dstrect after all clipping is performed. Returns:
Parameters:
int SDLmm::BaseSurface::Blit (const BaseSurface & src)Fast blit the entire source surface onto this surface.The source surface will be blitted to this surface. If the source area is larger than the destination, clipping will occur. No scaling will be performed. Blitting should not be used on a locked surface. The entire surface will be copied to this surface using this function. Returns:
Parameters:
bool SDLmm::BaseSurface::Fill (Uint8 r, Uint8 g, Uint8 b, Uint8 a) [inline]Fast fill the surface with the specified color.If a clipping rectangle has been set using SetClipRect(), only the area within that rectangle will be filled. Returns:
Parameters:
bool SDLmm::BaseSurface::Fill (Uint8 r, Uint8 g, Uint8 b) [inline]Fast fill the surface with the specified color.If a clipping rectangle has been set using SetClipRect(), only the area within that rectangle will be filled. Returns:
Parameters:
bool SDLmm::BaseSurface::Fill (Color color)Fast fill the surface with the specified color.If a clipping rectangle has been set using SetClipRect(), only the area within that rectangle will be filled. Returns:
Parameters:
bool SDLmm::BaseSurface::FillRect (SDL_Rect & dstrect, Uint8 r, Uint8 g, Uint8 b, Uint8 a) [inline]Performs a fast fill of the given rectangle with the specified color.If a clipping rectangle has been set using SetClipRect(), the area filled will be the intersection of the clipping rectangle and dstrect. Returns:
Parameters:
bool SDLmm::BaseSurface::FillRect (SDL_Rect & dstrect, Uint8 r, Uint8 g, Uint8 b) [inline]Performs a fast fill of the given rectangle with the specified color.If a clipping rectangle has been set using SetClipRect(), the area filled will be the intersection of the clipping rectangle and dstrect. Returns:
Parameters:
bool SDLmm::BaseSurface::FillRect (SDL_Rect & dstrect, Color color)Performs a fast fill of the given rectangle with the specified color.If a clipping rectangle has been set using SetClipRect(), the area filled will be the intersection of the clipping rectangle and dstrect. Returns:
Parameters:
void SDLmm::BaseSurface::GetClipRect (SDL_Rect & rect) constGets the clipping rectangle for the surface.Gets the clipping rectangle for a surface. When this surface is the destination of a blit, only the area within the clip rectangle is drawn into. Parameters:
See also:
Color SDLmm::BaseSurface::GetPixel (const SRect & point) const [inline]Get the color of the pixel.Warning:
Color SDLmm::BaseSurface::GetPixel (int x, int y) constGet the color of the pixel.Warning:
PixelFormat SDLmm::BaseSurface::GetPixelFormat () [inline]const PixelFormat SDLmm::BaseSurface::GetPixelFormat () const [inline]Returns the pixel format.const SDL_Surface * SDLmm::BaseSurface::GetSurface () const [inline]SDL_Surface * SDLmm::BaseSurface::GetSurface () [inline]bool SDLmm::BaseSurface::Lock ()Lock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise.void SDLmm::BaseSurface::ResetClipRect ()Resets the clipping rectangle for the surface.This functions resets the clipping to the full size of the surface. See also:
bool SDLmm::BaseSurface::SaveBMP (const std::string & file) const [inline]Save a BaseSurface object as a Windows bitmap file.Parameters:
Returns:
bool SDLmm::BaseSurface::SaveBMP (const char * file) constSave a BaseSurface object as a Windows bitmap file.Parameters:
Returns:
bool SDLmm::BaseSurface::SetAlpha (Uint32 flag, Uint8 alpha)Adjust the alpha properties of this surface.SetAlpha is used for setting the surface alpha value and / or enabling and disabling alpha blending. Parameters:
Note:
Returns:
void SDLmm::BaseSurface::SetClipRect (const SDL_Rect & rect)Sets the clipping rectangle for the surface.Sets the clipping rectangle for a surface. When this surface is the destination of a blit, only the area within the clip rectangle will be drawn into. Parameters:
See also:
bool SDLmm::BaseSurface::SetColorKey (Uint32 flag, Color 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, MapRGB() is often useful for obtaining an acceptable value. Returns:
Parameters:
bool SDLmm::BaseSurface::SetDisplayFormat () [pure virtual]Convert the surface to the display format.This function converts the surface to the pixel format and colors of the video framebuffer, making it suitable for fast blitting onto the display 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. Returns:
Note:
See also:
Reimplemented in SDLmm::Display, and SDLmm::Surface. bool SDLmm::BaseSurface::SetDisplayFormatAlpha () [pure virtual]Convert the surface to the display format.This function converts the surface to the pixel format and colors of the video framebuffer plus an alpha channel, making it suitable for fast blitting onto the display 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. Returns:
Note:
See also:
Reimplemented in SDLmm::Display, and SDLmm::Surface. void SDLmm::BaseSurface::SetPixel (const SRect & point, Color color) [inline]Set the pixel to the color.Warning:
void SDLmm::BaseSurface::SetPixel (int x, int y, Color color)Set the pixel to the color.Warning:
void SDLmm::BaseSurface::SetPixel1 (int x, int y, Color color)Set the pixel to the color.Warning:
void SDLmm::BaseSurface::SetPixel2 (int x, int y, Color color)Set the pixel to the color.Warning:
void SDLmm::BaseSurface::SetPixel3 (int x, int y, Color color)Set the pixel to the color.Warning:
void SDLmm::BaseSurface::SetPixel4 (int x, int y, Color color)Set the pixel to the color.Warning:
void SDLmm::BaseSurface::SetSurface (SDL_Surface * surface) [inline, protected, virtual]void SDLmm::BaseSurface::Unlock ()Unlock the surface.const SRect SDLmm::BaseSurface::clip_rect () const [inline]Returns the surface clip rectangle.Uint32 SDLmm::BaseSurface::flags () const [inline]Returns the surface flags.int SDLmm::BaseSurface::h () const [inline]Returns the height of the surface.struct private_hwdata * SDLmm::BaseSurface::hwdata () const [inline]Returns the hardware-specific surface info.BaseSurface & SDLmm::BaseSurface::operator= (const BaseSurface & other) [inline, protected]Uint16 SDLmm::BaseSurface::pitch () const [inline]Returns the scanline length in bytes.const void * SDLmm::BaseSurface::pixels () const [inline]Returns the pixel data, which can be used for low-level manipulation.Warning:
void * SDLmm::BaseSurface::pixels () [inline]Returns the pixel data, which can be used for low-level manipulation.Warning:
bool SDLmm::BaseSurface::valid () const [inline]Returns true if this surface is initialized, false otherwise.Warning:
int SDLmm::BaseSurface::w () const [inline]Returns the width of the surface.MEMBER DATA DOCUMENTATIONSDL_Surface * SDLmm::BaseSurface::me [protected]The actual SDL_Surface allocated for this BaseSurface.AUTHORGenerated automatically by Doxygen for SDLmm from the source code.
Visit the GSP FreeBSD Man Page Interface. |