Reference

CL_Texture(3)

Texture loading class for OpenGL.

NAME

CL_Texture - Texture loading class for OpenGL.

DESCRIPTION

This class can load the image(s) from surface provider into OpenGL textures.

This class works just like a surface, except that it requires the image width to be 2^n.

CLASS MEMBERS

static CL_Texture *create(
CL_SurfaceProvider *provider,
bool delete_provider=false)

static CL_Texture *load(
const char *id,
CL_ResourceManager *manager)

virtual ~CL_Texture()
virtual void bind(
int texture_no=0)

virtual CL_SurfaceProvider *get_provider()
virtual void reload()
virtual int get_width()
virtual int get_height()
virtual int get_no_textures()
virtual void flush(
CL_DisplayCard *card = NULL)

MEMBERS WITH DESCRIPTIONS

static CL_Texture *create(
CL_SurfaceProvider *provider,
bool delete_provider=false)

Parameters:
provider - Surface provider to use as image source.
delete_provider - If true, surface provider will be deleted
when the texture is deleted.

Description:

Creates a texture from a surface provider.

static CL_Texture *load(
const char *id,
CL_ResourceManager *manager)

Parameters:
id - Resource ID of the surface resource.
manager - Resource manager used to load the resource from.

Description:

Load the texture from a surface resource.

virtual ~CL_Texture()
Description:

virtual void bind(
int texture_no=0)

Parameters:
texture_no - Subframe in the provider to bind.

Description:

Bind the texture in OpenGL.

virtual CL_SurfaceProvider *get_provider()
Description:

Returns the surface provider.

virtual void reload()
Description:

Forces surface to reload texture data from provider.

virtual int get_width()
Description:

Returns the width of the surface

Return value:

Width of the texture.

virtual int get_height()
Description:

Returns the height of the texture

Return value:

Height of the texture.

virtual int get_no_textures()
Description:

Returns the number of subtextures in the texture

Return value:

Number of subtextures in texture.

virtual void flush(
CL_DisplayCard *card = NULL)

Description:

completely flushes textures (removes from video/system-memory)

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.