IND_SurfaceManager Class Reference
[IND_SurfaceManager]

List of all members.

Public Member Functions

bool Init (IND_ImageManager *pImageManager, IND_Render *pRender)
void End ()
bool Add (IND_Surface *pNewSurface, char *pName, IND_Type pType, IND_Quality pQuality)
bool Add (IND_Surface *pNewSurface, IND_Image *pImage, IND_Type pType, IND_Quality pQuality)
bool Add (IND_Surface *pNewSurface, char *pName, IND_Type pType, IND_Quality pQuality, byte pR, byte pG, byte pB)
bool Add (IND_Surface *pNewSurface, char *pName, int pBlockSize, IND_Type pType, IND_Quality pQuality)
bool Add (IND_Surface *pNewSurface, IND_Image *pImage, int pBlockSize, IND_Type pType, IND_Quality pQuality)
bool Add (IND_Surface *pNewSurface, char *pName, int pBlockSize, IND_Type pType, IND_Quality pQuality, byte pR, byte pG, byte pB)
bool Clone (IND_Surface *pNewSurface, IND_Surface *pSurfaceToClone)
bool Delete (IND_Surface *pSu)


Detailed Description

This class stores 2d surfaces (IND_Surface) that can be inserted into a IND_Entity2d and rendered to the screen using IND_Entity2dManager::RenderEntities2d().

IND_Surface is the most used object in the library due tu its versatility. Suppose that we use IndieLib to develop a game. The IND_Surface object will be the sprite of the main character or enemies, the background scroll, the tiles of the map, the markups of life, etc.

All graphic entities in IndieLib that are drawn in the screen as a surface, including text and animations, are internally managed by IND_Surface class.

One of the main characteristics of a IND_Surface is that it can have any desired size (it doesn't matter the maximum texture of the graphic card and they don't need to be power of two). And you can use a big IND_Surface as s a scroll, without worrying about the areas that are out of the screen (because blocks outside the viewport will be automatically discarded). Furthermore, to make easier the scrolls creation, the size of blocks, in which the surface is divided when it is created from a IND_Image object or directly from a graphic file, can be specified.

There are several types of surfaces (see IND_Type) , each type is used for a different purpose:

To save memory or to get black and white images, it is also possible to specify differents surfaces qualities (see IND_Quality).


surfa2.jpg

All the graphics entities in IndieLib are internally represented in surfaces


Member Function Documentation

bool IND_SurfaceManager::Init ( IND_ImageManager pImageManager,
IND_Render pRender 
)

parameters:

Operation:

This function returns 1 (true) when the manager is correctly initialized. It should be called before using any method.

void IND_SurfaceManager::End (  ) 

Operation:

This function free the manager and all the objects that it contains.

bool IND_SurfaceManager::Add ( IND_Surface pNewSurface,
char *  pName,
IND_Type  pType,
IND_Quality  pQuality 
)

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and it is added satisfactory loading the image directly from the file.

Graphic formats supported (Thanks to http://openil.sourceforge.net): bmp, png, tga, jpg y pcx.

bool IND_SurfaceManager::Add ( IND_Surface pNewSurface,
IND_Image pImage,
IND_Type  pType,
IND_Quality  pQuality 
)

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and it is added satisfactory to the manager, loading the image directly from a IND_Image object.

bool IND_SurfaceManager::Add ( IND_Surface pNewSurface,
char *  pName,
IND_Type  pType,
IND_Quality  pQuality,
byte  pR,
byte  pG,
byte  pB 
)

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and it is added satisfactory loading the image directly from the file and all the colors equal to RGB=(pR, pG, pB), will become transparent.

Graphic formats supported (Thanks to http://openil.sourceforge.net): bmp, png, tga, jpg and pcx.

bool IND_SurfaceManager::Add ( IND_Surface pNewSurface,
char *  pName,
int  pBlockSize,
IND_Type  pType,
IND_Quality  pQuality 
)

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and it is added satisfactory to the manager loading the image directly from a file. This method is useful for creating scrolls because we can specify the width of the block. Blocks outside the viewport will be automatically discarded.

Graphic formats supported (Thanks to http://openil.sourceforge.net): bmp, png, tga, jpg y pcx.

bool IND_SurfaceManager::Add ( IND_Surface pNewSurface,
IND_Image pImage,
int  pBlockSize,
IND_Type  pType,
IND_Quality  pQuality 
)

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and it is added satisfactory to the manager, loading the image directly from a IND_Image object.

This function returns 1 (true) if the parameter surface object exists and it is added satisfactory to the manager loading the image directly from a file. This method is useful for creating scrolls because we can specify the width of the block. BLocks outside the viewport will be automatically discarded.

bool IND_SurfaceManager::Add ( IND_Surface pNewSurface,
char *  pName,
int  pBlockSize,
IND_Type  pType,
IND_Quality  pQuality,
byte  pR,
byte  pG,
byte  pB 
)

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and it is added satisfactory to the manager loading the image directly from a file. This method is useful for creating scrolls because we can specify the width of the block. Blocks outside the viewport will be automatically discarded.

Graphic formats supported (Thanks to http://openil.sourceforge.net): bmp, png, tga, jpg y pcx.

bool IND_SurfaceManager::Clone ( IND_Surface pNewSurface,
IND_Surface pSurfaceToClone 
)

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and a new surface is created cloned from a previous existing one. The new surface will share the texture data from the "father" but will have it's own grid data. Show, if you want to have several IND_Surface objects with different grid assigned (see IND_Surface::SetGrid()) this is the way to go.

bool IND_SurfaceManager::Delete ( IND_Surface pSu  ) 

parameters:

Operation:

This function returns 1 (true) if the parameter surface object exists and it is satisfactory deleted from the manager.


The documentation for this class was generated from the following files:
Generated on Fri Jan 2 17:16:47 2009 for IndieLib by  doxygen 1.5.4