#include <sdlmm_basesurface.h>
Inheritance diagram for SDLmm::BaseSurface:
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... |
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.
|
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. |
|
|
|
The destructor.
|
|
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.
|
|
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).
|
|
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).
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
Get the color of the pixel.
|
|
Get the color of the pixel.
|
|
|
|
Returns the pixel format.
|
|
|
|
|
|
Lock the surface to allow direct access to the surface pixels. Returns true if lock succeeded, false otherwise.
|
|
Resets the clipping rectangle for the surface. This functions resets the clipping to the full size of the surface.
|
|
Save a BaseSurface object as a Windows bitmap file.
|
|
Save a BaseSurface object as a Windows bitmap file.
|
|
Adjust the alpha properties of this surface. SetAlpha is used for setting the surface alpha value and / or enabling and disabling alpha blending.
|
|
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.
|
|
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.
|
|
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.
Reimplemented in SDLmm::Display, and SDLmm::Surface. |
|
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.
Reimplemented in SDLmm::Display, and SDLmm::Surface. |
|
Set the pixel to the color.
|
|
Set the pixel to the color.
|
|
Set the pixel to the color.
|
|
Set the pixel to the color.
|
|
Set the pixel to the color.
|
|
Set the pixel to the color.
|
|
|
|
Unlock the surface.
|
|
Returns the surface clip rectangle.
|
|
Returns the surface flags.
|
|
Returns the height of the surface.
|
|
Returns the hardware-specific surface info.
|
|
|
|
Returns the scanline length in bytes.
|
|
Returns the pixel data, which can be used for low-level manipulation.
|
|
Returns the pixel data, which can be used for low-level manipulation.
|
|
Returns true if this surface is initialized, false otherwise.
|
|
Returns the width of the surface.
|
|
The actual SDL_Surface allocated for this BaseSurface.
|
Documentation automatically generated by ![]() |
Project hosted at |