CoglTextureFlags flags,
CoglPixelFormat internal_format);
+void
+_cogl_atlas_texture_add_reorganize_callback (GHookFunc callback,
+ void *user_data);
+
+void
+_cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
+ void *user_data);
+
#endif /* __COGL_ATLAS_TEXTURE_H */
{
CoglAtlas *atlas = user_data;
+ _COGL_GET_CONTEXT (ctx, NO_RETVAL);
+
if (atlas->map)
{
CoglAtlasTextureGetRectanglesData data;
g_free (data.textures);
}
+
+ /* Notify any listeners that an atlas has changed */
+ g_hook_list_invoke (&ctx->atlas_reorganize_callbacks, FALSE);
}
static void
return atlas_tex_handle;
}
+void
+_cogl_atlas_texture_add_reorganize_callback (GHookFunc callback,
+ void *user_data)
+{
+ GHook *hook;
+
+ _COGL_GET_CONTEXT (ctx, NO_RETVAL);
+
+ hook = g_hook_alloc (&ctx->atlas_reorganize_callbacks);
+ hook->func = callback;
+ hook->data = user_data;
+ g_hook_prepend (&ctx->atlas_reorganize_callbacks, hook);
+}
+
+void
+_cogl_atlas_texture_remove_reorganize_callback (GHookFunc callback,
+ void *user_data)
+{
+ GHook *hook;
+
+ _COGL_GET_CONTEXT (ctx, NO_RETVAL);
+
+ hook = g_hook_find_func_data (&ctx->atlas_reorganize_callbacks,
+ FALSE,
+ callback,
+ user_data);
+
+ if (hook)
+ g_hook_destroy_link (&ctx->atlas_reorganize_callbacks, hook);
+}
+
static const CoglTextureVtable
cogl_atlas_texture_vtable =
{
CoglPipeline *blit_texture_pipeline;
GSList *atlases;
+ GHookList atlas_reorganize_callbacks;
/* This debugging variable is used to pick a colour for visually
displaying the quad batches. It needs to be global so that it can
_cogl_flush_face_winding ();
context->atlases = NULL;
+ g_hook_list_init (&context->atlas_reorganize_callbacks, sizeof (GHook));
_context->buffer_map_fallback_array = g_byte_array_new ();
_context->buffer_map_fallback_in_use = FALSE;
_cogl_clip_stack_unref (context->current_clip_stack);
g_slist_free (context->atlases);
+ g_hook_list_clear (&context->atlas_reorganize_callbacks);
_cogl_bitmask_destroy (&context->arrays_enabled);
_cogl_bitmask_destroy (&context->temp_bitmask);