#include <sdlfilesurface.h>
Inheritance diagram for SdlFileSurface:
Public Member Functions | |
DECLSPEC | SdlFileSurface (const char *fn, const char *name=0, Uint32 colorkey=RGB(0, 0, 0), char *type=0, Uint32 flags=SDL_HWSURFACE) |
Protected Member Functions | |
virtual DECLSPEC void | onRefresh () |
The class supports the initialisation by specifying a file of one of the following formats:
BMP, JPG, PNG, TIF, PCX, TGA, PNM, XPM, XCF and LBM.
SdlFileSurface::SdlFileSurface | ( | const char * | fn, | |
const char * | name = 0 , |
|||
Uint32 | colorkey = RGB(0, 0, 0) , |
|||
char * | type = 0 , |
|||
Uint32 | flags = SDL_HWSURFACE | |||
) |
Constructor. Registers itself in SdlManager with the given name or, if name is NULL, with the given filename. After the construction, a surface buffer, initialized with the data of the given filename, the colorkey and flags is availible for usage. If initialisation failed, the fail-state is set.
fn | the filename of the image file | |
name | the resource's name | |
colorkey | the color, that is fully transparent when blitting | |
type | the type of the image file as string with 3 letters (as listed above); if NULL, the ending of the filename is used to detect the type | |
flags | the flags of the surface, for details, have a look at the SDL documentation; usually SDL_HWSURFACE is the best value. |
void SdlFileSurface::onRefresh | ( | ) | [protected, virtual] |
Refreshes the surface, by loading the buffer from the computer's RAM to the graphical RAM, if SDL_HWSURFACE used. This is neccessary, when resoring an application in MS Windows
Reimplemented from SdlSurface.