Method

StTextureCacheload

Declaration [src]

CoglTexture*
st_texture_cache_load (
  StTextureCache* cache,
  const char* key,
  StTextureCachePolicy policy,
  StTextureCacheLoader load,
  void* data,
  GError** error
)

Description [src]

Load an arbitrary texture, caching it. The string chosen for key should be of the form “type-prefix:type-uuid”. For example, “url:file:///usr/share/icons/hicolor/48x48/apps/firefox.png”, or “stock-icon:gtk-ok”.

This method is not directly available to language bindings.

Parameters

key

Type: const char*

Arbitrary string used to refer to item.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
policy

Type: StTextureCachePolicy

Caching policy.

load

Type: StTextureCacheLoader

Function to create the texture, if not already cached.

data

Type: void*

User data passed to load.

The argument can be NULL.
The data is owned by the caller of the method.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: CoglTexture

A newly-referenced handle to the texture.

The caller of the method takes ownership of the data, and is responsible for freeing it.