Exemplo n.º 1
0
void
cogl_path_polygon (CoglPath *path,
                   const float *coords,
                   int num_points)
{
  cogl_path_polyline (path, coords, num_points);
  cogl_path_close (path);
}
Exemplo n.º 2
0
Arquivo: proto.c Projeto: aalex/tempi
static void
test_paint_polyl (void)
{
  gfloat poly_coords[] = {
    -50, -50,
    +50, -30,
    +30, +30,
    -30, +40
  };

  cogl_path_polyline (poly_coords, 4);
}
static void
test_paint_polyl ()
{
  ClutterFixed poly_coords[] = {
    CLUTTER_INT_TO_FIXED (-50),
    CLUTTER_INT_TO_FIXED (-50),
    CLUTTER_INT_TO_FIXED (+50),
    CLUTTER_INT_TO_FIXED (-30),
    CLUTTER_INT_TO_FIXED (+30),
    CLUTTER_INT_TO_FIXED (+30),
    CLUTTER_INT_TO_FIXED (-30),
    CLUTTER_INT_TO_FIXED (+40)
  };
  
  cogl_path_polyline (poly_coords, 4);
}
Exemplo n.º 4
0
void cs_selected_paint (void)
{
  ClutterVertex verts[4];
  /* draw outlines for actors */
    GHashTableIter      iter;
    gpointer            key, value;

    {
        {
          if (cs->fake_stage)
            {
              cogl_set_source_color4ub (0, 255, 0, 255);
              cs_draw_actor_outline (cs->fake_stage, NULL);
            }
        }
    }

    cogl_set_source_color4ub (255, 0, 0, 128);
    cs_selected_foreach (G_CALLBACK (cs_draw_actor_outline), NULL);

    g_hash_table_iter_init (&iter, selection);
    while (g_hash_table_iter_next (&iter, &key, &value))
      {
        clutter_actor_get_abs_allocation_vertices (key,
                                                   verts);

        cogl_set_source_color4ub (0, 0, 25, 50);

        {
          {
            gfloat coords[]={ verts[0].x, verts[0].y, 
               verts[1].x, verts[1].y, 
               verts[3].x, verts[3].y, 
               verts[2].x, verts[2].y, 
               verts[0].x, verts[0].y };

            cogl_path_polyline (coords, 5);
            cogl_set_source_color4ub (0, 0, 255, 128);
            cogl_path_stroke ();
          }
        }
      }
   }