MxTextureCache

MxTextureCache — A per-process store to cache textures

Synopsis

                    MxTextureCache;
MxTextureCache*     mx_texture_cache_get_default        (void);
ClutterTexture*     mx_texture_cache_get_texture        (MxTextureCache *self,
                                                         const gchar *path);
ClutterActor*       mx_texture_cache_get_actor          (MxTextureCache *self,
                                                         const gchar *path);
CoglHandle          mx_texture_cache_get_cogl_texture   (MxTextureCache *self,
                                                         const gchar *path);
gint                mx_texture_cache_get_size           (MxTextureCache *self);
void                mx_texture_cache_load_cache         (MxTextureCache *self,
                                                         const char *filename);

Object Hierarchy

  GObject
   +----MxTextureCache

Description

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

Details

MxTextureCache

typedef struct _MxTextureCache MxTextureCache;

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


mx_texture_cache_get_default ()

MxTextureCache*     mx_texture_cache_get_default        (void);

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

Returns : (transfer none): a MxTextureCache

mx_texture_cache_get_texture ()

ClutterTexture*     mx_texture_cache_get_texture        (MxTextureCache *self,
                                                         const gchar *path);

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 MxTextureCache
path : A path to a image file
Returns : (transfer none): a newly created ClutterTexture

mx_texture_cache_get_actor ()

ClutterActor*       mx_texture_cache_get_actor          (MxTextureCache *self,
                                                         const gchar *path);

Create a new ClutterSubTexture 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.

Use this function if all you need is an actor for drawing.

self : A MxTextureCache
path : A path to a image file
Returns : (transfer none): a newly created ClutterTexture

mx_texture_cache_get_cogl_texture ()

CoglHandle          mx_texture_cache_get_cogl_texture   (MxTextureCache *self,
                                                         const gchar *path);

Create a CoglHandle representing a texture of 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 the CoglHandle of the previously loaded image with an increased reference count.

self : A MxTextureCache
path : A path to an image file
Returns : a CoglHandle to the cached texture

mx_texture_cache_get_size ()

gint                mx_texture_cache_get_size           (MxTextureCache *self);

Returns the number of items in the texture cache

self : A MxTextureCache
Returns : the current size of the cache

mx_texture_cache_load_cache ()

void                mx_texture_cache_load_cache         (MxTextureCache *self,
                                                         const char *filename);

self :
filename :