Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

SDLmm::BaseSurface Class Reference

An abstract base class for graphical surfaces. More...

#include <sdlmm_basesurface.h>

Inheritance diagram for SDLmm::BaseSurface::

SDLmm::Display SDLmm::Surface List of all members.

Public Methods

virtual ~BaseSurface ()
 The destructor. More...

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. More...

void Unlock ()
 Unlock the surface. More...

void SetPixel (int x, int y, Color color)
 Set the pixel to the color. More...

void SetPixel1 (int x, int y, Color color)
 Set the pixel to the color. More...

void SetPixel2 (int x, int y, Color color)
 Set the pixel to the color. More...

void SetPixel3 (int x, int y, Color color)
 Set the pixel to the color. More...

void SetPixel4 (int x, int y, Color color)
 Set the pixel to the color. More...

void SetPixel (const SRect &point, Color color)
 Set the pixel to the color. More...

Color GetPixel (int x, int y) const
 Get the color of the pixel. More...

Color GetPixel (const SRect &point) const
 Get the color of the pixel. More...

bool SetColorKey (Uint32 flag, Color key)
 Sets the color key (transparent pixel) in a blittable surface and enables or disables RLE blit acceleration. More...

bool SetAlpha (Uint32 flag, Uint8 alpha)
 Adjust the alpha properties of this surface. More...

virtual bool SetDisplayFormat ()=0
 Convert the surface to the display format. More...

virtual bool SetDisplayFormatAlpha ()=0
 Convert the surface to the display format. More...

bool SaveBMP (const char *file) const
 Save a BaseSurface object as a Windows bitmap file. More...

bool SaveBMP (const std::string &file) const
 Save a BaseSurface object as a Windows bitmap file. More...

Informational methods
bool valid () const
 Returns true if this surface is initialized, false otherwise. More...

Uint32 flags () const
 Returns the surface flags. More...

const PixelFormat GetPixelFormat () const
 Returns the pixel format. More...

PixelFormat GetPixelFormat ()
int w () const
 Returns the width of the surface. More...

int h () const
 Returns the height of the surface. More...

Uint16 pitch () const
 Returns the scanline length in bytes. More...

const SRect clip_rect () const
 Returns the surface clip rectangle. More...

void* pixels ()
 Returns the pixel data, which can be used for low-level manipulation. More...

const void* pixels () const
 Returns the pixel data, which can be used for low-level manipulation. More...

struct private_hwdata* hwdata () const
 Returns the hardware-specific surface info. More...

Clipping Methods
void ResetClipRect ()
 Resets the clipping rectangle for the surface. More...

void SetClipRect (const SDL_Rect &rect)
 Sets the clipping rectangle for the surface. More...

void GetClipRect (SDL_Rect &rect) const
 Gets the clipping rectangle for the surface. More...

Blitting / Filling
int Blit (const BaseSurface &src)
 Fast blit the entire source surface onto this surface. More...

int Blit (const BaseSurface &src, SDL_Rect &dstrect)
 Fast blit the entire source surface onto this surface at the specified coordinates. More...

int Blit (const BaseSurface &src, const SPoint &dstpoint, SDL_Rect &dstrect)
 Fast blit the entire source surface onto this surface at the specified coordinates. More...

int Blit (const BaseSurface &src, const SPoint &dstpoint)
 Fast blit the entire source surface onto this surface at the specified coordinates. More...

int 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. More...

int Blit (const BaseSurface &src, const SDL_Rect &srcrect, const SPoint &dstpoint, SDL_Rect &dstrect)
 Fast blit the specified area part of the source surface onto this surface at the specified coordinates. More...

int 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. More...

bool Fill (Color color)
 Fast fill the surface with the specified color. More...

bool Fill (Uint8 r, Uint8 g, Uint8 b)
 Fast fill the surface with the specified color. More...

bool Fill (Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Fast fill the surface with the specified color. More...

bool FillRect (SDL_Rect &dstrect, Color color)
 Performs a fast fill of the given rectangle with the specified color. More...

bool FillRect (SDL_Rect &dstrect, Uint8 r, Uint8 g, Uint8 b)
 Performs a fast fill of the given rectangle with the specified color. More...

bool FillRect (SDL_Rect &dstrect, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Performs a fast fill of the given rectangle with the specified color. More...


Protected Methods

virtual void SetSurface (SDL_Surface *surface)
 BaseSurface (SDL_Surface *surface)
 Constructor from an SDL_Surface*. More...

 BaseSurface (const BaseSurface &other)
BaseSurface& operator= (const BaseSurface &other)

Protected Attributes

SDL_Surface* me
 The actual SDL_Surface allocated for this BaseSurface. More...


Detailed Description

An 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:
David Hedbor <david@hedbor.org>

Definition at line 43 of file sdlmm_basesurface.h.


Constructor & Destructor Documentation

SDLmm::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.

Definition at line 63 of file sdlmm_basesurface.h.

SDLmm::BaseSurface::BaseSurface ( const BaseSurface & other ) [inline, protected]
 

Definition at line 67 of file sdlmm_basesurface.h.

SDLmm::BaseSurface::~BaseSurface ( ) [inline, virtual]
 

The destructor.

Definition at line 80 of file sdlmm_basesurface.h.


Member Function Documentation

int 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:
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.
Parameters:
src   the surface to blit from.
srcrect   the rectangular area to copy from the source surface.
dstpoint   the destination coordinates.

Definition at line 173 of file sdlmm_basesurface.cpp.

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:
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.
Parameters:
src   the surface to blit from.
srcrect   the rectangular area to copy from the source surface.
dstpoint   the destination coordinates.
dstrect   the final position and size is set upon returning.

Definition at line 398 of file sdlmm_basesurface.h.

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:
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.
Parameters:
src   the surface to blit from.
srcrect   the rectangular area to copy from the source surface.
dstrect   the destination coordinates. Only the position is used (i.e width and height are ignored). The width and height are set upon returning.

Definition at line 169 of file sdlmm_basesurface.cpp.

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:
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.
Parameters:
src   the surface to blit from.
dstpoint   the destination coordinates.

Definition at line 183 of file sdlmm_basesurface.cpp.

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:
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.
Parameters:
src   the surface to blit from.
dstpoint   the destination coordinates.
dstrect   the final position and size is set upon returning.

Definition at line 330 of file sdlmm_basesurface.h.

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:
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.
Parameters:
src   the surface to blit from.
dstrect   the destination coordinates. Only the position is used (i.e width and height are ignored). The width and height are set upon returning.

Definition at line 179 of file sdlmm_basesurface.cpp.

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:
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.
Parameters:
src   the surface to blit from.

Definition at line 189 of file sdlmm_basesurface.cpp.

Referenced by Blit().

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:
Returns true for success, false if there was an error.
Parameters:
r, g, b   the red, green and blue color values.
a   the alpha value

Definition at line 447 of file sdlmm_basesurface.h.

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:
Returns true for success, false if there was an error.
Parameters:
r, g, b   the red, green and blue color values.

Definition at line 437 of file sdlmm_basesurface.h.

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:
Returns true for success, false if there was an error.
Parameters:
color   the color to fill with, generated by MapRGB() or MapRGBA().

Definition at line 193 of file sdlmm_basesurface.cpp.

Referenced by Fill().

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:
Returns true for success, false if there was an error.
Parameters:
dstrect   the rectangle to fill, upon returning it contains the clipped rectangle that was actually filled.
r, g, b   the red, green and blue color values.
a   the alpha value

Definition at line 484 of file sdlmm_basesurface.h.

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:
Returns true for success, false if there was an error.
Parameters:
dstrect   the rectangle to fill, upon returning it contains the clipped rectangle that was actually filled.
r, g, b   the red, green and blue color values.

Definition at line 471 of file sdlmm_basesurface.h.

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:
Returns true for success, false if there was an error.
Parameters:
dstrect   the rectangle to fill, upon returning it contains the clipped rectangle that was actually filled.
color   the color to fill with, generated by MapRGB() or MapRGBA().

Definition at line 197 of file sdlmm_basesurface.cpp.

Referenced by FillRect().

void SDLmm::BaseSurface::GetClipRect ( SDL_Rect & rect ) const
 

Gets 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:
rect   reference to a rectangle which will be filled with the clipping rectangle of this surface.
See also:
SetClipRect, ResetClipRect, Blit

Definition at line 218 of file sdlmm_basesurface.cpp.

Color SDLmm::BaseSurface::GetPixel ( const SRect & point ) const [inline]
 

Get the color of the pixel.

Warning:
You can only use this function when the surface is locked.

Definition at line 194 of file sdlmm_basesurface.h.

Color SDLmm::BaseSurface::GetPixel ( int x,
int y ) const
 

Get the color of the pixel.

Warning:
You can only use this function when the surface is locked.

Definition at line 124 of file sdlmm_basesurface.cpp.

Referenced by GetPixel().

PixelFormat SDLmm::BaseSurface::GetPixelFormat ( ) [inline]
 

Definition at line 114 of file sdlmm_basesurface.h.

const PixelFormat SDLmm::BaseSurface::GetPixelFormat ( ) const [inline]
 

Returns the pixel format.

Definition at line 113 of file sdlmm_basesurface.h.

Referenced by Fill(), FillRect(), GetPixel(), SetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().

const SDL_Surface * SDLmm::BaseSurface::GetSurface ( ) const [inline]
 

Definition at line 91 of file sdlmm_basesurface.h.

SDL_Surface * SDLmm::BaseSurface::GetSurface ( ) [inline]
 

Definition at line 86 of file sdlmm_basesurface.h.

Referenced by GetPixelFormat(), clip_rect(), flags(), h(), hwdata(), pitch(), pixels(), and w().

bool SDLmm::BaseSurface::Lock ( )
 

Lock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise.

Definition at line 30 of file sdlmm_basesurface.cpp.

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:
GetClipRect, SetClipRect, Blit

Definition at line 214 of file sdlmm_basesurface.cpp.

bool SDLmm::BaseSurface::SaveBMP ( const std::string & file ) const [inline]
 

Save a BaseSurface object as a Windows bitmap file.

Parameters:
file   the file name to save to.
Returns:
True if the loading succeeded, false otherwise.

Definition at line 544 of file sdlmm_basesurface.h.

bool SDLmm::BaseSurface::SaveBMP ( const char * file ) const
 

Save a BaseSurface object as a Windows bitmap file.

Parameters:
file   the file name to save to.
Returns:
True if the loading succeeded, false otherwise.

Definition at line 222 of file sdlmm_basesurface.cpp.

Referenced by SaveBMP().

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:
flag   used to specify whether alpha blending should be used (SDL_SRCALPHA) and whether the surface should use RLE acceleration for blitting (SDL_RLEACCEL). flag 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.
alpha   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.

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.

Returns:
true for success or false if there was an error.

Definition at line 206 of file sdlmm_basesurface.cpp.

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:
rect   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.

See also:
GetClipRect, ResetClipRect, Blit

Definition at line 210 of file sdlmm_basesurface.cpp.

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:
Returns true for success, false if there was an error.
Parameters:
flag   If

Definition at line 202 of file sdlmm_basesurface.cpp.

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:
The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the BaseSurface object will not have changed.

Note:
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.

See also:
SetDisplayFormatAlpha(), SetAlpha(), SetColorKey()

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:
The functions returns true if the conversion succeeded or false otherwise. If the conversion failed, the BaseSurface object will not have changed.

Note:
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.

See also:
SetDisplayFormat(), SetAlpha(), SetColorKey()

Reimplemented in SDLmm::Display, and SDLmm::Surface.

void SDLmm::BaseSurface::SetPixel ( const SRect & point,
Color color ) [inline]
 

Set the pixel to the color.

Warning:
You can only use this function when the surface is locked.

Definition at line 182 of file sdlmm_basesurface.h.

void SDLmm::BaseSurface::SetPixel ( int x,
int y,
Color color )
 

Set the pixel to the color.

Warning:
You can only use this function when the surface is locked.

Definition at line 93 of file sdlmm_basesurface.cpp.

Referenced by SetPixel().

void SDLmm::BaseSurface::SetPixel1 ( int x,
int y,
Color color )
 

Set the pixel to the color.

Warning:
You can only use this function when the surface is locked and when the bytes per pixel is 1.

Definition at line 43 of file sdlmm_basesurface.cpp.

Referenced by SetPixel().

void SDLmm::BaseSurface::SetPixel2 ( int x,
int y,
Color color )
 

Set the pixel to the color.

Warning:
You can only use this function when the surface is locked and when the bytes per pixel is 2.

Definition at line 53 of file sdlmm_basesurface.cpp.

Referenced by SetPixel().

void SDLmm::BaseSurface::SetPixel3 ( int x,
int y,
Color color )
 

Set the pixel to the color.

Warning:
You can only use this function when the surface is locked and when the bytes per pixel is 3.

Definition at line 63 of file sdlmm_basesurface.cpp.

Referenced by SetPixel().

void SDLmm::BaseSurface::SetPixel4 ( int x,
int y,
Color color )
 

Set the pixel to the color.

Warning:
You can only use this function when the surface is locked and when the bytes per pixel is 4.

Definition at line 83 of file sdlmm_basesurface.cpp.

Referenced by SetPixel().

void SDLmm::BaseSurface::SetSurface ( SDL_Surface * surface ) [inline, protected, virtual]
 

Definition at line 48 of file sdlmm_basesurface.h.

Referenced by SDLmm::Surface::SetDisplayFormat(), SDLmm::Surface::SetDisplayFormatAlpha(), and operator=().

void SDLmm::BaseSurface::Unlock ( )
 

Unlock the surface.

Definition at line 37 of file sdlmm_basesurface.cpp.

const SRect SDLmm::BaseSurface::clip_rect ( ) const [inline]
 

Returns the surface clip rectangle.

Definition at line 126 of file sdlmm_basesurface.h.

Uint32 SDLmm::BaseSurface::flags ( ) const [inline]
 

Returns the surface flags.

Definition at line 110 of file sdlmm_basesurface.h.

int SDLmm::BaseSurface::h ( ) const [inline]
 

Returns the height of the surface.

Definition at line 120 of file sdlmm_basesurface.h.

Referenced by GetPixel(), SetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().

struct private_hwdata * SDLmm::BaseSurface::hwdata ( ) const [inline]
 

Returns the hardware-specific surface info.

Definition at line 141 of file sdlmm_basesurface.h.

BaseSurface & SDLmm::BaseSurface::operator= ( const BaseSurface & other ) [inline, protected]
 

Definition at line 71 of file sdlmm_basesurface.h.

Uint16 SDLmm::BaseSurface::pitch ( ) const [inline]
 

Returns the scanline length in bytes.

Definition at line 123 of file sdlmm_basesurface.h.

Referenced by GetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().

const void * SDLmm::BaseSurface::pixels ( ) const [inline]
 

Returns the pixel data, which can be used for low-level manipulation.

Warning:
You can only modify this surface when the surface is locked.

Definition at line 138 of file sdlmm_basesurface.h.

void * SDLmm::BaseSurface::pixels ( ) [inline]
 

Returns the pixel data, which can be used for low-level manipulation.

Warning:
You can only modify this surface when the surface is locked.

Definition at line 132 of file sdlmm_basesurface.h.

Referenced by GetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().

bool SDLmm::BaseSurface::valid ( ) const [inline]
 

Returns true if this surface is initialized, false otherwise.

Warning:
Using an uninitialzied surface can cause many problems.

Definition at line 107 of file sdlmm_basesurface.h.

int SDLmm::BaseSurface::w ( ) const [inline]
 

Returns the width of the surface.

Definition at line 117 of file sdlmm_basesurface.h.

Referenced by GetPixel(), SetPixel(), SetPixel1(), SetPixel2(), SetPixel3(), and SetPixel4().


Member Data Documentation

SDL_Surface * SDLmm::BaseSurface::me [protected]
 

The actual SDL_Surface allocated for this BaseSurface.

Definition at line 47 of file sdlmm_basesurface.h.


The documentation for this class was generated from the following files:
Documentation automatically generated by doxygen written by Dimitri van Heesch. Project hosted at
Hosted by SourceForge