Represents a surface.
More...
#include <Surface.h>
List of all members.
Public Member Functions |
| Surface () |
| Surface (SDL_Surface *surface) |
| Surface (const string &fileName) |
| Surface (int height, int width, int bpp, unsigned int flags) |
| Surface (Uint32 flags, const Rect &rect, int bpp, const Color &mask) |
| Surface (void *pixels, const Rect &rect, int bpp, int pitch, const Color &mask) |
| ~Surface () |
| Surface (const Surface &rhs) |
Surface & | operator= (const Surface &rhs) |
Surface & | blit (Surface &surface, const Rect &srcRect, const Rect &dstRect) |
int | height () |
int | width () |
int | bpp () |
bool | lock () |
void | unlock () |
bool | save (const string &fileName) |
SDL_Surface *const | to_c () const |
Detailed Description
Represents a surface.
Definition at line 43 of file Surface.h.
Constructor & Destructor Documentation
sdl::video::Surface::Surface |
( |
| ) |
[inline] |
Constructs a Surface from the current display surface.
- Exceptions:
-
runtime_error | Throws a runtime_error if unable to get current system display. |
Definition at line 50 of file Surface.h.
sdl::video::Surface::Surface |
( |
SDL_Surface * |
surface | ) |
[inline] |
Constructs a Surface from a SDL_Surface structure.
- Parameters:
-
The | SDL_Surface structure. |
- Exceptions:
-
runtime_error | Throws a runtime_error if surface is NULL. |
Definition at line 62 of file Surface.h.
sdl::video::Surface::Surface |
( |
const string & |
fileName | ) |
[inline] |
Constructs a Surface from a file.
- Parameters:
-
fileName | The name of the file. |
- Exceptions:
-
runtime_error | Throws a runtime_error if unable to load bitmap. |
Definition at line 74 of file Surface.h.
sdl::video::Surface::Surface |
( |
int |
height, |
|
|
int |
width, |
|
|
int |
bpp, |
|
|
unsigned int |
flags |
|
) |
| [inline] |
Constructs a Surface.
- Parameters:
-
height | The height. |
width | The width. |
bpp | The bits per pixel. |
flags | The surface flags. |
- Exceptions:
-
runtime_error | Throws a runtime_error if unable to set video mode. |
Definition at line 89 of file Surface.h.
sdl::video::Surface::Surface |
( |
Uint32 |
flags, |
|
|
const Rect & |
rect, |
|
|
int |
bpp, |
|
|
const Color & |
mask |
|
) |
| [inline] |
Constructs a Surface.
- Parameters:
-
flags | The SDL Surface flags. |
rect | A rectangle with the height and width. |
bpp | The number of bits per pixel. |
mask | The color mask. |
- Exceptions:
-
runtime_error | Throws a runtime_error if unable to create RGB surface. |
Definition at line 105 of file Surface.h.
sdl::video::Surface::Surface |
( |
void * |
pixels, |
|
|
const Rect & |
rect, |
|
|
int |
bpp, |
|
|
int |
pitch, |
|
|
const Color & |
mask |
|
) |
| [inline] |
Constructs a Surface from the provided pixel data.
- Parameters:
-
pixels | The pixel data. |
rect | A rectangle with the height and width. |
bpp | The number of bits per pixel. |
pitch | The size of the scanline in bytes, width in pixels * bytes per pixel. |
mask | The color mask. |
- Exceptions:
-
runtime_error | Throws a runtime_error if unable to create RGB surface. |
Definition at line 124 of file Surface.h.
sdl::video::Surface::~Surface |
( |
| ) |
[inline] |
sdl::video::Surface::Surface |
( |
const Surface & |
rhs | ) |
[inline] |
Member Function Documentation
Blits the source rectangle from one Surface onto the destination rectangle of this Surface.
- Parameters:
-
surface | The Surface from which to blit. |
srcRect | The source rectangle. |
dstRect | The destination rectangle. |
- Returns:
- A reference to this Surface.
- Exceptions:
-
runtime_error | Throws a runtime_error if unable to blit. |
Definition at line 168 of file Surface.h.
int sdl::video::Surface::bpp |
( |
| ) |
[inline] |
Returns the number of bits per pixel.
- Returns:
- The number of bits per pixel.
Definition at line 203 of file Surface.h.
int sdl::video::Surface::height |
( |
| ) |
[inline] |
Returns the height.
- Returns:
- The height.
Definition at line 189 of file Surface.h.
bool sdl::video::Surface::lock |
( |
| ) |
[inline] |
Locks the Surface.
- Returns:
- True if successful, false otherwise.
Definition at line 210 of file Surface.h.
Surface& sdl::video::Surface::operator= |
( |
const Surface & |
rhs | ) |
[inline] |
The assignment operator.
- Parameters:
-
rhs | The Surface from which to assign. |
- Returns:
- A reference to this Surface.
Definition at line 151 of file Surface.h.
bool sdl::video::Surface::save |
( |
const string & |
fileName | ) |
[inline] |
Save the Surface to the named file.
- Parameters:
-
fileName | The name of the file. |
- Returns:
- True if successful, false otherwise.
Definition at line 224 of file Surface.h.
SDL_Surface* const sdl::video::Surface::to_c |
( |
| ) |
const [inline] |
Exposes the underlying SDL_Surface structure.
- Returns:
- The SDL_Surface structure.
Definition at line 231 of file Surface.h.
void sdl::video::Surface::unlock |
( |
| ) |
[inline] |
int sdl::video::Surface::width |
( |
| ) |
[inline] |
Returns the width.
- Returns:
- The width.
Definition at line 196 of file Surface.h.
The documentation for this class was generated from the following file: