---
name: "CL_Texture"
section: "3"
platform: "linux"
package: "clanlib0-common-dev"
version: "0.4.4-8"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/CL_Texture"
---

# 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 \<*mbn@dark.x.dtu.dk*\> and Martin Starch \<*starch@dark.x.dtu.dk*\>. 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.
