Reference

CL_SpriteProvider(3)

ClanLib datafile sprite. Used to load surfaces stored in ClanLib's datafile sprite format.

NAME

CL_SpriteProvider - ClanLib datafile sprite. Used to load surfaces stored in ClanLib's datafile sprite format.

CLASS MEMBERS

static CL_Surface *create(
const char *surface_id,
CL_InputSourceProvider *datafile)

CL_SpriteProvider(
const char *surface_id,
CL_InputSourceProvider *datafile)

virtual ~CL_SpriteProvider()
virtual unsigned int get_width()
virtual unsigned int get_height()
virtual unsigned int get_pitch()
virtual unsigned int get_num_frames()
virtual CL_Palette *get_palette()
virtual bool uses_src_colorkey()
virtual unsigned int get_src_colorkey()
virtual unsigned int get_red_mask()
virtual unsigned int get_green_mask()
virtual unsigned int get_blue_mask()
virtual unsigned int get_alpha_mask()
virtual unsigned int get_depth()
virtual bool is_indexed()
virtual void *get_data()
virtual void perform_lock()
virtual void perform_unlock()

MEMBERS WITH DESCRIPTIONS

static CL_Surface *create(
const char *surface_id,
CL_InputSourceProvider *datafile)

Description:

Loads the sprite surface_id from the inputsource provider datafile. Creates a surface using this sprite (surfaceprovider) and returns it.This function is a easier way of typing: CL_Surface::create(new CL_Sprite(surface_id, datafile), true);

CL_SpriteProvider(
const char *surface_id,
CL_InputSourceProvider *datafile)

Description:

Constructs a surface provider that represents the sprite surface_id from the inputsource provider datafile.

virtual ~CL_SpriteProvider()
Description:

virtual unsigned int get_width()
Description:

Returns the width of the sprite.

virtual unsigned int get_height()
Description:

Returns the height of the sprite.

virtual unsigned int get_pitch()
Description:

Returns the pitch of the sprite.

virtual unsigned int get_num_frames()
Description:

Returns the number of subsprites in this sprite.

virtual CL_Palette *get_palette()
Description:

Returns the palette used by the surface. NULL if the system palette is used.

virtual bool uses_src_colorkey()
Description:

virtual unsigned int get_src_colorkey()
Description:

Returns the transparency color used, or -1 if none.

virtual unsigned int get_red_mask()
Description:

virtual unsigned int get_green_mask()
Description:

virtual unsigned int get_blue_mask()
Description:

virtual unsigned int get_alpha_mask()
Description:

virtual unsigned int get_depth()
Description:

virtual bool is_indexed()
Description:

virtual void *get_data()
Description:

Returns a pointer to the sprites image data. Can only be called between lock() and unlock().

virtual void perform_lock()
Description:

Locks the surface provider. This causes the sprite to retrieve its surface data from the datafile.

virtual void perform_unlock()
Description:

Unlocks the surface provider. The sprite releases its surface data whenit is called.

SEE ALSO

All ClanLib API classes can be found in clanlib (3).

AUTHORS

Originally written by Magnus Norddahl <[email protected]> and Martin Starch <[email protected]>. ClanLib is now developed by the ClanLib Development team as an Open Source project.

The ClanLib man pages was created using the Perceps documentation system (another excellent piece of Open Source software, available at http://somewhere.in.the.world.org).

See clanlib (3) to find out how to get a full list of contributors and details on how to submit bug reports, comments etc.