338
354
clutter_stage_set_title (CLUTTER_STAGE (stage), "Shader Test");
339
355
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
357
file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL);
341
359
#ifndef TEST_GROUP
342
actor = g_object_new (CLUTTER_TYPE_TEXTURE,
343
"filename", "redhand.png",
344
"disable-slicing", TRUE,
346
actor = clutter_texture_new_from_file ("redhand.png", &error);
360
actor = clutter_texture_new_from_file (file, &error);
348
362
g_error("pixbuf load failed: %s", error ? error->message : "Unknown");
351
364
actor = clutter_group_new ();
353
ClutterActor *child1, *child2, *child3, *child4;
354
ClutterColor color = { 0xff, 0x22, 0x66, 0x99 };
356
child1 = clutter_texture_new_from_file ("redhand.png", &error);
358
g_error("pixbuf load failed: %s", error ? error->message : "Unknown");
359
child2 = clutter_texture_new_from_file ("redhand.png", &error);
361
g_error("pixbuf load failed: %s", error ? error->message : "Unknown");
362
child3 = clutter_rectangle_new ();
363
child4 = clutter_text_new_with_text ("Sans 20px", "Shady stuff");
365
clutter_rectangle_set_color (child3, &color);
366
clutter_actor_set_size (child3, 50, 50);
367
clutter_actor_set_position (child1, 0, 0);
368
clutter_actor_set_position (child2, 50, 100);
369
clutter_actor_set_position (child3, 30, -30);
370
clutter_actor_set_position (child4, -50, 20);
372
clutter_group_add (CLUTTER_GROUP (actor), child1);
373
clutter_group_add (CLUTTER_GROUP (actor), child2);
374
clutter_group_add (CLUTTER_GROUP (actor), child3);
375
clutter_group_add (CLUTTER_GROUP (actor), child4);
377
clutter_actor_show_all (actor);
367
ClutterActor *child1, *child2, *child3, *child4;
368
ClutterColor color = { 0xff, 0x22, 0x66, 0x99 };
370
child1 = clutter_texture_new_from_file (file, &error);
372
g_error("pixbuf load failed: %s", error ? error->message : "Unknown");
374
child2 = clutter_texture_new_from_file (file, &error);
376
g_error("pixbuf load failed: %s", error ? error->message : "Unknown");
378
child3 = clutter_rectangle_new ();
379
child4 = clutter_text_new_with_text ("Sans 20px", "Shady stuff");
381
clutter_rectangle_set_color (CLUTTER_RECTANGLE (child3), &color);
382
clutter_actor_set_size (child3, 50, 50);
384
clutter_actor_set_position (child1, 0, 0);
385
clutter_actor_set_position (child2, 50, 100);
386
clutter_actor_set_position (child3, 30, -30);
387
clutter_actor_set_position (child4, -50, 20);
389
clutter_container_add (CLUTTER_CONTAINER (actor),
396
clutter_actor_show_all (actor);
398
#endif /* !TEST_GROUP */
381
402
clutter_actor_set_shader (actor, shader);
382
403
clutter_actor_set_position (actor, 100, 100);