.TH "SDLmm::BaseSurface" 3 "16 Jul 2001" "SDLmm" \" -*- nroff -*- .ad l .nh .SH NAME SDLmm::BaseSurface \- An abstract base class for graphical surfaces. .SH SYNOPSIS .br .PP \fC#include \fP .PP Inherited by \fBSDLmm::Display\fP, and \fBSDLmm::Surface\fP. .PP .SS "Public Methods" .in +1c .ti -1c .RI "virtual \fB~BaseSurface\fP ()" .br .RI "\fIThe destructor.\fP" .ti -1c .RI "SDL_Surface* \fBGetSurface\fP ()" .br .ti -1c .RI "const SDL_Surface* \fBGetSurface\fP () const" .br .ti -1c .RI "bool \fBLock\fP ()" .br .RI "\fILock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise.\fP" .ti -1c .RI "void \fBUnlock\fP ()" .br .RI "\fIUnlock the surface.\fP" .ti -1c .RI "void \fBSetPixel\fP (int x, int y, \fBColor\fP color)" .br .RI "\fISet the pixel to the color.\fP" .ti -1c .RI "void \fBSetPixel1\fP (int x, int y, \fBColor\fP color)" .br .RI "\fISet the pixel to the color.\fP" .ti -1c .RI "void \fBSetPixel2\fP (int x, int y, \fBColor\fP color)" .br .RI "\fISet the pixel to the color.\fP" .ti -1c .RI "void \fBSetPixel3\fP (int x, int y, \fBColor\fP color)" .br .RI "\fISet the pixel to the color.\fP" .ti -1c .RI "void \fBSetPixel4\fP (int x, int y, \fBColor\fP color)" .br .RI "\fISet the pixel to the color.\fP" .ti -1c .RI "void \fBSetPixel\fP (const \fBSRect\fP &point, \fBColor\fP color)" .br .RI "\fISet the pixel to the color.\fP" .ti -1c .RI "\fBColor\fP \fBGetPixel\fP (int x, int y) const" .br .RI "\fIGet the color of the pixel.\fP" .ti -1c .RI "\fBColor\fP \fBGetPixel\fP (const \fBSRect\fP &point) const" .br .RI "\fIGet the color of the pixel.\fP" .ti -1c .RI "bool \fBSetColorKey\fP (Uint32 flag, \fBColor\fP key)" .br .RI "\fISets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration.\fP" .ti -1c .RI "bool \fBSetAlpha\fP (Uint32 flag, Uint8 alpha)" .br .RI "\fIAdjust the alpha properties of this surface.\fP" .ti -1c .RI "virtual bool \fBSetDisplayFormat\fP ()=0" .br .RI "\fIConvert the surface to the display format.\fP" .ti -1c .RI "virtual bool \fBSetDisplayFormatAlpha\fP ()=0" .br .RI "\fIConvert the surface to the display format.\fP" .ti -1c .RI "bool \fBSaveBMP\fP (const char *file) const" .br .RI "\fISave a \fBBaseSurface\fP object as a Windows bitmap file.\fP" .ti -1c .RI "bool \fBSaveBMP\fP (const std::string &file) const" .br .RI "\fISave a \fBBaseSurface\fP object as a Windows bitmap file.\fP" .in -1c .PP .RI "\fBInformational methods\fP" .br .in +1c .in +1c .ti -1c .RI "bool \fBvalid\fP () const" .br .RI "\fIReturns true if this surface is initialized, false otherwise.\fP" .ti -1c .RI "Uint32 \fBflags\fP () const" .br .RI "\fIReturns the surface flags.\fP" .ti -1c .RI "const \fBPixelFormat\fP \fBGetPixelFormat\fP () const" .br .RI "\fIReturns the pixel format.\fP" .ti -1c .RI "\fBPixelFormat\fP \fBGetPixelFormat\fP ()" .br .ti -1c .RI "int \fBw\fP () const" .br .RI "\fIReturns the width of the surface.\fP" .ti -1c .RI "int \fBh\fP () const" .br .RI "\fIReturns the height of the surface.\fP" .ti -1c .RI "Uint16 \fBpitch\fP () const" .br .RI "\fIReturns the scanline length in bytes.\fP" .ti -1c .RI "const \fBSRect\fP \fBclip_rect\fP () const" .br .RI "\fIReturns the surface clip rectangle.\fP" .ti -1c .RI "void* \fBpixels\fP ()" .br .RI "\fIReturns the pixel data, which can be used for low-level manipulation.\fP" .ti -1c .RI "const void* \fBpixels\fP () const" .br .RI "\fIReturns the pixel data, which can be used for low-level manipulation.\fP" .ti -1c .RI "struct private_hwdata* \fBhwdata\fP () const" .br .RI "\fIReturns the hardware-specific surface info.\fP" .in -1c .in -1c .PP .RI "\fBClipping Methods\fP" .br .in +1c .in +1c .ti -1c .RI "void \fBResetClipRect\fP ()" .br .RI "\fIResets the clipping rectangle for the surface.\fP" .ti -1c .RI "void \fBSetClipRect\fP (const \fBSDL_Rect\fP &rect)" .br .RI "\fISets the clipping rectangle for the surface.\fP" .ti -1c .RI "void \fBGetClipRect\fP (\fBSDL_Rect\fP &rect) const" .br .RI "\fIGets the clipping rectangle for the surface.\fP" .in -1c .in -1c .PP .RI "\fBBlitting / Filling\fP" .br .in +1c .in +1c .ti -1c .RI "int \fBBlit\fP (const BaseSurface &src)" .br .RI "\fIFast blit the entire source surface onto this surface.\fP" .ti -1c .RI "int \fBBlit\fP (const BaseSurface &src, \fBSDL_Rect\fP &dstrect)" .br .RI "\fIFast blit the entire source surface onto this surface at the specified coordinates.\fP" .ti -1c .RI "int \fBBlit\fP (const BaseSurface &src, const \fBSPoint\fP &dstpoint, \fBSDL_Rect\fP &dstrect)" .br .RI "\fIFast blit the entire source surface onto this surface at the specified coordinates.\fP" .ti -1c .RI "int \fBBlit\fP (const BaseSurface &src, const \fBSPoint\fP &dstpoint)" .br .RI "\fIFast blit the entire source surface onto this surface at the specified coordinates.\fP" .ti -1c .RI "int \fBBlit\fP (const BaseSurface &src, const \fBSDL_Rect\fP &srcrect, \fBSDL_Rect\fP &dstrect)" .br .RI "\fIFast blit the specified area part of the source surface onto this surface at the specified coordinates.\fP" .ti -1c .RI "int \fBBlit\fP (const BaseSurface &src, const \fBSDL_Rect\fP &srcrect, const \fBSPoint\fP &dstpoint, \fBSDL_Rect\fP &dstrect)" .br .RI "\fIFast blit the specified area part of the source surface onto this surface at the specified coordinates.\fP" .ti -1c .RI "int \fBBlit\fP (const BaseSurface &src, const \fBSDL_Rect\fP &srcrect, const \fBSPoint\fP &dstpoint)" .br .RI "\fIFast blit the specified area part of the source surface onto this surface at the specified coordinates.\fP" .ti -1c .RI "bool \fBFill\fP (\fBColor\fP color)" .br .RI "\fIFast fill the surface with the specified color.\fP" .ti -1c .RI "bool \fBFill\fP (Uint8 r, Uint8 g, Uint8 b)" .br .RI "\fIFast fill the surface with the specified color.\fP" .ti -1c .RI "bool \fBFill\fP (Uint8 r, Uint8 g, Uint8 b, Uint8 a)" .br .RI "\fIFast fill the surface with the specified color.\fP" .ti -1c .RI "bool \fBFillRect\fP (\fBSDL_Rect\fP &dstrect, \fBColor\fP color)" .br .RI "\fIPerforms a fast fill of the given rectangle with the specified color.\fP" .ti -1c .RI "bool \fBFillRect\fP (\fBSDL_Rect\fP &dstrect, Uint8 r, Uint8 g, Uint8 b)" .br .RI "\fIPerforms a fast fill of the given rectangle with the specified color.\fP" .ti -1c .RI "bool \fBFillRect\fP (\fBSDL_Rect\fP &dstrect, Uint8 r, Uint8 g, Uint8 b, Uint8 a)" .br .RI "\fIPerforms a fast fill of the given rectangle with the specified color.\fP" .in -1c .in -1c .SS "Protected Methods" .in +1c .ti -1c .RI "virtual void \fBSetSurface\fP (SDL_Surface *surface)" .br .ti -1c .RI "\fBBaseSurface\fP (SDL_Surface *surface)" .br .RI "\fIConstructor from an SDL_Surface*.\fP" .ti -1c .RI "\fBBaseSurface\fP (const BaseSurface &other)" .br .ti -1c .RI "BaseSurface& \fBoperator=\fP (const BaseSurface &other)" .br .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "SDL_Surface* \fBme\fP" .br .RI "\fIThe actual SDL_Surface allocated for this \fBBaseSurface\fP.\fP" .in -1c .SH "DETAILED DESCRIPTION" .PP An abstract base class for graphical surfaces. .PP 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 \fBSurface\fP. The clipping rectangle returned by \fBclip_rect\fP() can be set with \fBSetClipRect\fP() method. .PP \fBAuthor: \fP .in +1c David Hedbor .PP .SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION" .PP .SS "SDLmm::BaseSurface::BaseSurface (SDL_Surface * surface)\fC [inline, explicit, protected]\fP" .PP Constructor from an SDL_Surface*. .PP This creates a new \fBBaseSurface\fP object from an existing SDL_Surface. Note that ownership of the SDL_Surface is passed on to the \fBBaseSurface\fP. 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. .SS "SDLmm::BaseSurface::BaseSurface (const BaseSurface & other)\fC [inline, protected]\fP" .PP .SS "SDLmm::BaseSurface::~BaseSurface ()\fC [inline, virtual]\fP" .PP The destructor. .PP .SH "MEMBER FUNCTION DOCUMENTATION" .PP .SS "int SDLmm::BaseSurface::Blit (const BaseSurface & src, const \fBSDL_Rect\fP & srcrect, const \fBSPoint\fP & dstpoint)" .PP Fast blit the specified area part of the source surface onto this surface at the specified coordinates. .PP 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. .PP \fBReturns: \fP .in +1c If the blit is successful, it returns 0, otherwise it returns -1. If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost. It should be reloaded with artwork and re-blitted. .PP \fBParameters: \fP .in +1c .TP \fB\fIsrc\fP\fP the surface to blit from. .TP \fB\fIsrcrect\fP\fP the rectangular area to copy from the source surface. .TP \fB\fIdstpoint\fP\fP the destination coordinates. .SS "int SDLmm::BaseSurface::Blit (const BaseSurface & src, const \fBSDL_Rect\fP & srcrect, const \fBSPoint\fP & dstpoint, \fBSDL_Rect\fP & dstrect)\fC [inline]\fP" .PP Fast blit the specified area part of the source surface onto this surface at the specified coordinates. .PP 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 \fIdstrect\fP after all clipping is performed (\fIsrcrect\fP is not modified). .PP \fBReturns: \fP .in +1c If the blit is successful, it returns 0, otherwise it returns -1. If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost. It should be reloaded with artwork and re-blitted. .PP \fBParameters: \fP .in +1c .TP \fB\fIsrc\fP\fP the surface to blit from. .TP \fB\fIsrcrect\fP\fP the rectangular area to copy from the source surface. .TP \fB\fIdstpoint\fP\fP the destination coordinates. .TP \fB\fIdstrect\fP\fP the final position and size is set upon returning. .SS "int SDLmm::BaseSurface::Blit (const BaseSurface & src, const \fBSDL_Rect\fP & srcrect, \fBSDL_Rect\fP & dstrect)" .PP Fast blit the specified area part of the source surface onto this surface at the specified coordinates. .PP 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 \fIdstrect\fP after all clipping is performed (\fIsrcrect\fP is not modified). .PP \fBReturns: \fP .in +1c If the blit is successful, it returns 0, otherwise it returns -1. If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost. It should be reloaded with artwork and re-blitted. .PP \fBParameters: \fP .in +1c .TP \fB\fIsrc\fP\fP the surface to blit from. .TP \fB\fIsrcrect\fP\fP the rectangular area to copy from the source surface. .TP \fB\fIdstrect\fP\fP the destination coordinates. Only the position is used (i.e width and height are ignored). The width and height are set upon returning. .SS "int SDLmm::BaseSurface::Blit (const BaseSurface & src, const \fBSPoint\fP & dstpoint)" .PP Fast blit the entire source surface onto this surface at the specified coordinates. .PP 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. .PP \fBReturns: \fP .in +1c If the blit is successful, it returns 0, otherwise it returns -1. If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost. It should be reloaded with artwork and re-blitted. .PP \fBParameters: \fP .in +1c .TP \fB\fIsrc\fP\fP the surface to blit from. .TP \fB\fIdstpoint\fP\fP the destination coordinates. .SS "int SDLmm::BaseSurface::Blit (const BaseSurface & src, const \fBSPoint\fP & dstpoint, \fBSDL_Rect\fP & dstrect)\fC [inline]\fP" .PP Fast blit the entire source surface onto this surface at the specified coordinates. .PP 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 \fIdstrect\fP after all clipping is performed. .PP \fBReturns: \fP .in +1c If the blit is successful, it returns 0, otherwise it returns -1. If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost. It should be reloaded with artwork and re-blitted. .PP \fBParameters: \fP .in +1c .TP \fB\fIsrc\fP\fP the surface to blit from. .TP \fB\fIdstpoint\fP\fP the destination coordinates. .TP \fB\fIdstrect\fP\fP the final position and size is set upon returning. .SS "int SDLmm::BaseSurface::Blit (const BaseSurface & src, \fBSDL_Rect\fP & dstrect)" .PP Fast blit the entire source surface onto this surface at the specified coordinates. .PP 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 \fIdstrect\fP after all clipping is performed. .PP \fBReturns: \fP .in +1c If the blit is successful, it returns 0, otherwise it returns -1. If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost. It should be reloaded with artwork and re-blitted. .PP \fBParameters: \fP .in +1c .TP \fB\fIsrc\fP\fP the surface to blit from. .TP \fB\fIdstrect\fP\fP the destination coordinates. Only the position is used (i.e width and height are ignored). The width and height are set upon returning. .SS "int SDLmm::BaseSurface::Blit (const BaseSurface & src)" .PP Fast blit the entire source surface onto this surface. .PP 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. .PP \fBReturns: \fP .in +1c If the blit is successful, it returns 0, otherwise it returns -1. If either of the surfaces were in video memory, and the blit returns -2, the video memory was lost. It should be reloaded with artwork and re-blitted. .PP \fBParameters: \fP .in +1c .TP \fB\fIsrc\fP\fP the surface to blit from. .SS "bool SDLmm::BaseSurface::Fill (Uint8 r, Uint8 g, Uint8 b, Uint8 a)\fC [inline]\fP" .PP Fast fill the surface with the specified color. .PP If a clipping rectangle has been set using \fBSetClipRect\fP(), only the area within that rectangle will be filled. .PP \fBReturns: \fP .in +1c Returns true for success, false if there was an error. .PP \fBParameters: \fP .in +1c .TP \fB\fIr, g, b\fP\fP the red, green and blue color values. .TP \fB\fIa\fP\fP the alpha value .SS "bool SDLmm::BaseSurface::Fill (Uint8 r, Uint8 g, Uint8 b)\fC [inline]\fP" .PP Fast fill the surface with the specified color. .PP If a clipping rectangle has been set using \fBSetClipRect\fP(), only the area within that rectangle will be filled. .PP \fBReturns: \fP .in +1c Returns true for success, false if there was an error. .PP \fBParameters: \fP .in +1c .TP \fB\fIr, g, b\fP\fP the red, green and blue color values. .SS "bool SDLmm::BaseSurface::Fill (\fBColor\fP color)" .PP Fast fill the surface with the specified color. .PP If a clipping rectangle has been set using \fBSetClipRect\fP(), only the area within that rectangle will be filled. .PP \fBReturns: \fP .in +1c Returns true for success, false if there was an error. .PP \fBParameters: \fP .in +1c .TP \fB\fIcolor\fP\fP the color to fill with, generated by MapRGB() or MapRGBA(). .SS "bool SDLmm::BaseSurface::FillRect (\fBSDL_Rect\fP & dstrect, Uint8 r, Uint8 g, Uint8 b, Uint8 a)\fC [inline]\fP" .PP Performs a fast fill of the given rectangle with the specified color. .PP If a clipping rectangle has been set using \fBSetClipRect\fP(), the area filled will be the intersection of the clipping rectangle and \fIdstrect\fP. .PP \fBReturns: \fP .in +1c Returns true for success, false if there was an error. .PP \fBParameters: \fP .in +1c .TP \fB\fIdstrect\fP\fP the rectangle to fill, upon returning it contains the clipped rectangle that was actually filled. .TP \fB\fIr, g, b\fP\fP the red, green and blue color values. .TP \fB\fIa\fP\fP the alpha value .SS "bool SDLmm::BaseSurface::FillRect (\fBSDL_Rect\fP & dstrect, Uint8 r, Uint8 g, Uint8 b)\fC [inline]\fP" .PP Performs a fast fill of the given rectangle with the specified color. .PP If a clipping rectangle has been set using \fBSetClipRect\fP(), the area filled will be the intersection of the clipping rectangle and \fIdstrect\fP. .PP \fBReturns: \fP .in +1c Returns true for success, false if there was an error. .PP \fBParameters: \fP .in +1c .TP \fB\fIdstrect\fP\fP the rectangle to fill, upon returning it contains the clipped rectangle that was actually filled. .TP \fB\fIr, g, b\fP\fP the red, green and blue color values. .SS "bool SDLmm::BaseSurface::FillRect (\fBSDL_Rect\fP & dstrect, \fBColor\fP color)" .PP Performs a fast fill of the given rectangle with the specified color. .PP If a clipping rectangle has been set using \fBSetClipRect\fP(), the area filled will be the intersection of the clipping rectangle and \fIdstrect\fP. .PP \fBReturns: \fP .in +1c Returns true for success, false if there was an error. .PP \fBParameters: \fP .in +1c .TP \fB\fIdstrect\fP\fP the rectangle to fill, upon returning it contains the clipped rectangle that was actually filled. .TP \fB\fIcolor\fP\fP the color to fill with, generated by MapRGB() or MapRGBA(). .SS "void SDLmm::BaseSurface::GetClipRect (\fBSDL_Rect\fP & rect) const" .PP Gets the clipping rectangle for the surface. .PP 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. .PP \fBParameters: \fP .in +1c .TP \fB\fIrect\fP\fP reference to a rectangle which will be filled with the clipping rectangle of this surface. .PP \fBSee also: \fP .in +1c \fBSetClipRect\fP, \fBResetClipRect\fP, \fBBlit\fP .SS "\fBColor\fP SDLmm::BaseSurface::GetPixel (const \fBSRect\fP & point) const\fC [inline]\fP" .PP Get the color of the pixel. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked. .SS "\fBColor\fP SDLmm::BaseSurface::GetPixel (int x, int y) const" .PP Get the color of the pixel. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked. .SS "\fBPixelFormat\fP SDLmm::BaseSurface::GetPixelFormat ()\fC [inline]\fP" .PP .SS "const \fBPixelFormat\fP SDLmm::BaseSurface::GetPixelFormat () const\fC [inline]\fP" .PP Returns the pixel format. .PP .SS "const SDL_Surface * SDLmm::BaseSurface::GetSurface () const\fC [inline]\fP" .PP .SS "SDL_Surface * SDLmm::BaseSurface::GetSurface ()\fC [inline]\fP" .PP .SS "bool SDLmm::BaseSurface::Lock ()" .PP Lock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise. .PP .SS "void SDLmm::BaseSurface::ResetClipRect ()" .PP Resets the clipping rectangle for the surface. .PP This functions resets the clipping to the full size of the surface. .PP \fBSee also: \fP .in +1c \fBGetClipRect\fP, \fBSetClipRect\fP, \fBBlit\fP .SS "bool SDLmm::BaseSurface::SaveBMP (const std::string & file) const\fC [inline]\fP" .PP Save a \fBBaseSurface\fP object as a Windows bitmap file. .PP \fBParameters: \fP .in +1c .TP \fB\fIfile\fP\fP the file name to save to. .PP \fBReturns: \fP .in +1c True if the loading succeeded, false otherwise. .SS "bool SDLmm::BaseSurface::SaveBMP (const char * file) const" .PP Save a \fBBaseSurface\fP object as a Windows bitmap file. .PP \fBParameters: \fP .in +1c .TP \fB\fIfile\fP\fP the file name to save to. .PP \fBReturns: \fP .in +1c True if the loading succeeded, false otherwise. .SS "bool SDLmm::BaseSurface::SetAlpha (Uint32 flag, Uint8 alpha)" .PP Adjust the alpha properties of this surface. .PP SetAlpha is used for setting the surface alpha value and / or enabling and disabling alpha blending. .PP \fBParameters: \fP .in +1c .TP \fB\fIflag\fP\fP used to specify whether alpha blending should be used (SDL_SRCALPHA) and whether the surface should use RLE acceleration for blitting (SDL_RLEACCEL). \fIflag\fP can be an OR'd combination of these two options, one of these options or 0. If SDL_SRCALPHA is not passed as a flag then all alpha information is ignored when blitting the surface. .TP \fB\fIalpha\fP\fP the per-surface alpha value; a surface need not have an alpha channel to use per-surface alpha and blitting can still be accelerated with SDL_RLEACCEL. .PP \fBNote: \fP .in +1c 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. .PP \fBReturns: \fP .in +1c true for success or false if there was an error. .SS "void SDLmm::BaseSurface::SetClipRect (const \fBSDL_Rect\fP & rect)" .PP Sets the clipping rectangle for the surface. .PP 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. .PP \fBParameters: \fP .in +1c .TP \fB\fIrect\fP\fP The rectangle pointed to by rect will be clipped to the edges of the surface so that the clip rectangle for a surface can never fall outside the edges of the surface. .PP \fBSee also: \fP .in +1c \fBGetClipRect\fP, \fBResetClipRect\fP, \fBBlit\fP .SS "bool SDLmm::BaseSurface::SetColorKey (Uint32 flag, \fBColor\fP key)" .PP Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration. .PP RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the \fIkey\fP value). The key must be of the same pixel format as the surface, MapRGB() is often useful for obtaining an acceptable value. .PP \fBReturns: \fP .in +1c Returns true for success, false if there was an error. .PP \fBParameters: \fP .in +1c .TP \fB\fIflag\fP\fP If .SS "bool SDLmm::BaseSurface::SetDisplayFormat ()\fC [pure virtual]\fP" .PP Convert the surface to the display format. .PP 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. .PP 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. .PP \fBReturns: \fP .in +1c The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the \fBBaseSurface\fP object will not have changed. .PP \fBNote: \fP .in +1c Please note that this function doesn't return a new, modified object like the SDL_DisplayFormat() function does. Thus there is no need to manually free the old surface. .PP \fBSee also: \fP .in +1c \fBSetDisplayFormatAlpha\fP(), \fBSetAlpha\fP(), \fBSetColorKey\fP() .PP Reimplemented in \fBSDLmm::Display\fP, and \fBSDLmm::Surface\fP. .SS "bool SDLmm::BaseSurface::SetDisplayFormatAlpha ()\fC [pure virtual]\fP" .PP Convert the surface to the display format. .PP 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. .PP 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. .PP \fBReturns: \fP .in +1c The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the \fBBaseSurface\fP object will not have changed. .PP \fBNote: \fP .in +1c Please note that this function doesn't return a new, modified object like the SDL_DisplayFormatAlpha() function does. Thus there is no need to manually free the old surface. .PP \fBSee also: \fP .in +1c \fBSetDisplayFormat\fP(), \fBSetAlpha\fP(), \fBSetColorKey\fP() .PP Reimplemented in \fBSDLmm::Display\fP, and \fBSDLmm::Surface\fP. .SS "void SDLmm::BaseSurface::SetPixel (const \fBSRect\fP & point, \fBColor\fP color)\fC [inline]\fP" .PP Set the pixel to the color. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked. .SS "void SDLmm::BaseSurface::SetPixel (int x, int y, \fBColor\fP color)" .PP Set the pixel to the color. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked. .SS "void SDLmm::BaseSurface::SetPixel1 (int x, int y, \fBColor\fP color)" .PP Set the pixel to the color. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked and when the bytes per pixel is 1. .SS "void SDLmm::BaseSurface::SetPixel2 (int x, int y, \fBColor\fP color)" .PP Set the pixel to the color. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked and when the bytes per pixel is 2. .SS "void SDLmm::BaseSurface::SetPixel3 (int x, int y, \fBColor\fP color)" .PP Set the pixel to the color. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked and when the bytes per pixel is 3. .SS "void SDLmm::BaseSurface::SetPixel4 (int x, int y, \fBColor\fP color)" .PP Set the pixel to the color. .PP \fBWarning: \fP .in +1c You can only use this function when the surface is locked and when the bytes per pixel is 4. .SS "void SDLmm::BaseSurface::SetSurface (SDL_Surface * surface)\fC [inline, protected, virtual]\fP" .PP .SS "void SDLmm::BaseSurface::Unlock ()" .PP Unlock the surface. .PP .SS "const \fBSRect\fP SDLmm::BaseSurface::clip_rect () const\fC [inline]\fP" .PP Returns the surface clip rectangle. .PP .SS "Uint32 SDLmm::BaseSurface::flags () const\fC [inline]\fP" .PP Returns the surface flags. .PP .SS "int SDLmm::BaseSurface::h () const\fC [inline]\fP" .PP Returns the height of the surface. .PP .SS "struct private_hwdata * SDLmm::BaseSurface::hwdata () const\fC [inline]\fP" .PP Returns the hardware-specific surface info. .PP .SS "BaseSurface & SDLmm::BaseSurface::operator= (const BaseSurface & other)\fC [inline, protected]\fP" .PP .SS "Uint16 SDLmm::BaseSurface::pitch () const\fC [inline]\fP" .PP Returns the scanline length in bytes. .PP .SS "const void * SDLmm::BaseSurface::pixels () const\fC [inline]\fP" .PP Returns the pixel data, which can be used for low-level manipulation. .PP \fBWarning: \fP .in +1c You can only modify this surface when the surface is locked. .SS "void * SDLmm::BaseSurface::pixels ()\fC [inline]\fP" .PP Returns the pixel data, which can be used for low-level manipulation. .PP \fBWarning: \fP .in +1c You can only modify this surface when the surface is locked. .SS "bool SDLmm::BaseSurface::valid () const\fC [inline]\fP" .PP Returns true if this surface is initialized, false otherwise. .PP \fBWarning: \fP .in +1c Using an uninitialzied surface can cause many problems. .SS "int SDLmm::BaseSurface::w () const\fC [inline]\fP" .PP Returns the width of the surface. .PP .SH "MEMBER DATA DOCUMENTATION" .PP .SS "SDL_Surface * SDLmm::BaseSurface::me\fC [protected]\fP" .PP The actual SDL_Surface allocated for this \fBBaseSurface\fP. .PP .SH "AUTHOR" .PP Generated automatically by Doxygen for SDLmm from the source code.