2 #include <clutter/clutter.h>
3 #include <clutter-gtk/gtk-clutter-embed.h>
6 main (int argc, char *argv[])
8 ClutterTimeline *timeline;
9 ClutterActor *stage1, *stage2, *tex1, *tex2;
10 ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff };
11 GtkWidget *window, *clutter1, *clutter2;
12 GtkWidget *label, *button, *vbox;
15 ClutterColor col1 = { 0xff, 0xff, 0xff, 0xff };
16 ClutterColor col2 = { 0, 0, 0, 0xff };
18 gtk_init (&argc, &argv);
19 gtk_clutter_init (&argc, &argv);
21 pixbuf = gdk_pixbuf_new_from_file ("redhand.png", NULL);
24 g_error("pixbuf load failed");
26 tex1 = clutter_texture_new_from_pixbuf (pixbuf);
27 tex2 = clutter_clone_texture_new (tex1);
29 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
30 g_signal_connect (window, "destroy",
31 G_CALLBACK (gtk_main_quit), NULL);
33 vbox = gtk_vbox_new (FALSE, 6);
34 gtk_container_add (GTK_CONTAINER (window), vbox);
36 clutter1 = gtk_clutter_embed_new ();
37 gtk_widget_set_size_request (clutter1, 320, 240);
38 stage1 = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (clutter1));
39 clutter_stage_set_color (CLUTTER_STAGE(stage1), &col1);
40 clutter_stage_add (stage1, tex1);
42 gtk_container_add (GTK_CONTAINER (vbox), clutter1);
44 clutter2 = gtk_clutter_embed_new ();
45 gtk_widget_set_size_request (clutter2, 320, 240);
46 stage2 = gtk_clutter_embed_get_stage (GTK_CLUTTER_EMBED (clutter2));
48 clutter_stage_set_color (CLUTTER_STAGE(stage2), &col2);
49 clutter_stage_add (stage2, tex2);
51 gtk_container_add (GTK_CONTAINER (vbox), clutter2);
53 gtk_widget_show_all (window);
54 clutter_actor_show_all (stage1);
55 clutter_actor_show_all (stage2);