Hi all,
I just create a very simple animation with a text move from left to
right , but it is not smooth , a little bits choppy. Although it is
not serious, it should be able to achieve better quality. Any hints to
improve the quality? Is it related to vblank?
The source code of sample program is attached. It was tested in
following environment:
Ubuntu 7.0.4 + Clutter 0.8 / 0.6 + Intel i945 display chip
Debian SID + Clutter 0.8 / 0.6 + NVidia 8400 series display chip
Thanks.
/* gcc -g `pkg-config --cflags --libs clutter-0.8 ` animation.c */
#include <clutter/clutter.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
clutter_init (&argc, &argv);
ClutterColor actor_color = { 0xff, 0x0, 0x0, 0xff };
/* Get the stage and set its size and color: */
ClutterActor *stage = clutter_stage_get_default ();
clutter_actor_set_size (stage, 1024, 768);
/* Add a label to the stage: */
ClutterActor *label = clutter_label_new_full ("Sans 60", "Some Text", &actor_color);
clutter_actor_set_size (label, 500, 500);
clutter_actor_set_position (label, 20, 150);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), label);
clutter_actor_show (label);
/* Move it up and to the right: */
clutter_actor_move_by (label, 10, -10);
ClutterTimeline *timeline = clutter_timeline_new (120,30);
clutter_timeline_set_loop (timeline,TRUE);
clutter_timeline_start (timeline);
ClutterKnot knots[] = {{ 100,100},{700,100},{100,100}};
ClutterAlpha *alpha = clutter_alpha_new_full (timeline, CLUTTER_ALPHA_RAMP_INC, NULL, NULL);
ClutterBehaviour* path = clutter_behaviour_path_new(alpha,knots,3);
clutter_behaviour_apply(path,label);
/* Show the stage: */
clutter_actor_show (stage);
/* Start the main loop, so we can respond to events: */
clutter_main ();
return EXIT_SUCCESS;
}