Reference

CL_SurfaceProvider(3)

The image source interface.

NAME

CL_SurfaceProvider - The image source interface.

DESCRIPTION

This is the interface used by a surface to load an image. For more information about the relationship between a surface and its provider, please the CL_Surface class description.

The surface provider interface extends the renderer target interface with some blitting related functions. Currently, this is translation of the image and colorkey transparency.

ClanLib includes a large range of surface providers that can load an image from various sources: PCX, TGA, PNG and so on.

If you want to be able to load your (newly created) surface provider as a resource, you have to implement the CL_ResourceSource_Surface as well.

Inherited from public CL_Target

CLASS MEMBERS

static CL_SurfaceProvider *load(
 const char *resource_id,
CL_ResourceManager *manager)

virtual ~CL_SurfaceProvider()
virtual int get_translate_x()
virtual int get_translate_y()
virtual bool uses_src_colorkey()
virtual unsigned int get_src_colorkey()

MEMBERS WITH DESCRIPTIONS

static CL_SurfaceProvider *load(
 const char *resource_id,
CL_ResourceManager *manager)

Description:

This function loads a surface provider from a resource file (usually a datafile).

virtual ~CL_SurfaceProvider()
Description:

virtual int get_translate_x()
Description:

Returns the offset of the surface_data returned by get_data(). This translation will be applied to every putscreen using a given surfaceproviders data as input.

Return value:

The x-offset of the surface data.

virtual int get_translate_y()
Description:

Returns the offset of the surface_data returned by get_data(). This translation will be applied to every putscreen using a given surfaceproviders data as input.

Return value:

The y-offset of the surface data.

virtual bool uses_src_colorkey()
Description:

Returns true if the surface provider uses a source color key.

virtual unsigned int get_src_colorkey()
Description:

Returns the source color key.

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.