static void circle_paint_cb (ClutterActor *actor) { const CoglColor fill_color = { 0xff, 0xff, 0xff, 0x80 }; gint i; gdouble angle; guint radius = clutter_actor_get_width (actor) / 2; cogl_set_source_color (&fill_color); angle = *((gdouble *)g_object_get_data (G_OBJECT (actor), "angle")); for (i = 0; i < CIRCLE_S; i++, angle += (2.0 * G_PI) / (gdouble) CIRCLE_S) { gdouble angle2 = angle + ((2.0 * G_PI) / (gdouble)CIRCLE_S) / 2.0; cogl_path_move_to (((radius - CIRCLE_W) * cos (angle)) + radius, ((radius - CIRCLE_W) * sin (angle)) + radius); cogl_path_arc (radius, radius, radius, radius, CLUTTER_ANGLE_FROM_RAD (angle), CLUTTER_ANGLE_FROM_RAD (angle2)); cogl_path_line_to (((radius - CIRCLE_W) * cos (angle2)) + radius, ((radius - CIRCLE_W) * sin (angle2)) + radius); cogl_path_arc (radius, radius, radius - CIRCLE_W, radius - CIRCLE_W, CLUTTER_ANGLE_FROM_RAD (angle2), CLUTTER_ANGLE_FROM_RAD (angle)); cogl_path_close (); cogl_path_fill (); } }
void cogl_set_source_color4ub (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) { CoglColor c = { 0, }; cogl_color_init_from_4ub (&c, red, green, blue, alpha); cogl_set_source_color (&c); }
void cogl_set_source_color4f (float red, float green, float blue, float alpha) { CoglColor c = { 0, }; cogl_color_init_from_4f (&c, red, green, blue, alpha); cogl_set_source_color (&c); }
void cogl_set_source_color4ub (guint8 red, guint8 green, guint8 blue, guint8 alpha) { CoglColor c = { 0, }; cogl_color_set_from_4ub (&c, red, green, blue, alpha); cogl_set_source_color (&c); }