NbtkTextureCache

NbtkTextureCache — A per-process store to cache textures

Synopsis

                    NbtkTextureCache;
NbtkTextureCache*   nbtk_texture_cache_get_default      (void);
ClutterTexture*     nbtk_texture_cache_get_texture      (NbtkTextureCache *self,
                                                         const gchar *path,
                                                         gboolean want_clone);
gint                nbtk_texture_cache_get_size         (NbtkTextureCache *self);

Object Hierarchy

  GObject
   +----NbtkTextureCache

Description

NbtkTextureCache allows an application to re-use an previously loaded textures.

Details

NbtkTextureCache

typedef struct _NbtkTextureCache NbtkTextureCache;

The contents of this structure are private and should only be accessed through the public API.


nbtk_texture_cache_get_default ()

NbtkTextureCache*   nbtk_texture_cache_get_default      (void);

Returns the default texture cache. This is owned by Nbtk and should not be unreferenced or freed.

Returns :

a NbtkTextureCache

nbtk_texture_cache_get_texture ()

ClutterTexture*     nbtk_texture_cache_get_texture      (NbtkTextureCache *self,
                                                         const gchar *path,
                                                         gboolean want_clone);

Create a new ClutterTexture with the specified image. Adds the image to the cache if the image had not been previously loaded. Subsequent calls with the same image path will return a new ClutterTexture with the previously loaded image.

self :

A NbtkTextureCache

path :

A path to a image file

want_clone :

ignored

Returns :

a newly created ClutterTexture

nbtk_texture_cache_get_size ()

gint                nbtk_texture_cache_get_size         (NbtkTextureCache *self);

Returns the number of items in the texture cache

self :

A NbtkTextureCache

Returns :

the current size of the cache