$treeview $search $mathjax
Stratagus
2.2.6
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <image.h>
Public Member Functions | |
Image (void *data, int width, int height) | |
Image (const std::string &filename) | |
virtual | ~Image () |
virtual int | getWidth () const |
virtual int | getHeight () const |
virtual void * | _getData () const |
Static Public Member Functions | |
static ImageLoader * | _getImageLoader () |
static void | setImageLoader (ImageLoader *imageLoader) |
Protected Member Functions | |
Image () | |
Protected Attributes | |
void * | mData |
int | mWidth |
int | mHeight |
bool | mLoadedWithImageLoader |
Static Protected Attributes | |
static ImageLoader * | mImageLoader = NULL |
Image::setImageLoader(myImageLoader)
EXAMPLE: If you use SDLGraphics you should use SDLImageLoader. Otherwise your program will crash in a most bizarre way.
Image::Image | ( | void * | data, | |
int | width, | |||
int | height | |||
) |
Constructor.
data | the data of the image. | |
width | the width of the image. | |
height | the height of the image. |
Image::Image | ( | const std::string & | filename | ) |
Constructor.
filename | the filename of the image. |
Exception | when no ImageLoader exists. |
Image::~Image | ( | ) | [virtual] |
Destructor. Unloads the image with the ImageLoader, if it was loaded with it.
Image::Image | ( | ) | [protected] |
Default constructor. It is protected so you can inherit from this class.
int Image::getWidth | ( | ) | const [virtual] |
int Image::getHeight | ( | ) | const [virtual] |
void * Image::_getData | ( | ) | const [virtual] |
Gets the data of the Image. Image data can be different things depending on what ImageLoader you use. If you for instance use the SDLImageLoader then an SDL_Surface will be returned.
Reimplemented in CGraphic.
ImageLoader * Image::_getImageLoader | ( | ) | [static] |
Gets the ImageLoader used for loading Images.
void Image::setImageLoader | ( | ImageLoader * | imageLoader | ) | [static] |
Sets the ImageLoader to be used for loading images.
IMPORTANT: The ImageLoader is static and MUST be set before loading images!
imageLoader | the ImageLoader to be used for loading images. |
void* gcn::Image::mData [protected] |
int gcn::Image::mWidth [protected] |
int gcn::Image::mHeight [protected] |
bool gcn::Image::mLoadedWithImageLoader [protected] |
ImageLoader * Image::mImageLoader = NULL [static, protected] |