On Wed, 2009-12-02 at 16:54 +0200, Aapo Rantalainen wrote:
> Hi, thanks, I got it working.
>
> In test-threads.c there was this row:
> clutter_threads_add_idle_full (G_PRIORITY_DEFAULT + 30,
> update_label_idle,
> update, NULL);
>
> So I though it is safe to put my clutter_* code same place. (So is
> this clutter_threads_add_idle_full also in clutter API or not?)
no; the API subset that's clearly thread-related and that it safe
(unless obviously not - like clutter_threads_init() and
clutter_threads_set_lock_functions() - but these are clearly marked as
such) to be called from another thread is set in the clutter_threads_*
sub-namespace. we cannot put it in another namespace altogether - this
is still Clutter API.
> Now I put my code under update_label_idle, which have clutter_actor_*
> calls, so this might be safe place?
yes; idle and timeout callbacks will be executed from within the same
thread that is spinning the main loop.
> I have lots of code using ClutterScript and json files. I realized
> that my target platform is too slow to load actors when needed, but it
> has lots of memory. I would like to use existing code, not to rewrite
> them using 'load-async'.
load-async is a GObject property, and can be defined using
ClutterScript:
{
"type" : "ClutterTexture",
"load-async" : true,
"filename" : "/path/to/filename",
}
will load the file asynchronously - as long as you use Clutter from
master, which guarantees the ordering of object members; otherwise just
set load-async to true and call clutter_texture_set_from_filename()
explicitly.
ciao,
Emmanuele.
--
To unsubscribe send a mail to [email protected]