On Fri, 2009-05-08 at 08:54 +0800, 明覺 wrote:
> I'm following the cluttermm programming tutorial at
> http://www.openismus.com/documents/cluttermm_tutorial/0.9/docs/tutorial/html/custom-actor-example.html,
> the compiler output this error message:
> ----------------------------------------------------------------------------------------
> error: ‘ClutterFixed_REPLACED_BY_CoglFixed’ was not declared in this scope
> error: ‘CLUTTER_INT_TO_FIXED_REPLACED_BY_COGL_FIXED_FROM_INT’ was not
> declared in this scope
> ----------------------------------------------------------------------------------------
> 
> after I changed ClutterFixed to CoglFixed, and CLUTTER_INT_TO_FIXED to
> COGL_FIXED_FROM_INT, it output this error message:
> ----------------------------------------------------------------------------------------
> error: cannot convert ‘CoglFixed*’ to ‘float*’ for argument ‘1’ to
> ‘void cogl_path_polygon(float*, gint)’
> ----------------------------------------------------------------------------------------
> 
> how could i solve it? what's the correct way to do it? thank

Cogl API uses floating point, not fixed point types. the tutorial should
be fixed to reflect this.

the code snippet:

  ClutterFixed coords[6];

  // Paint a triangle.  The parent paint call will have translated us into
  // position so paint from 0, 0.
  coords[0] = CLUTTER_INT_TO_FIXED(0);
  coords[1] = CLUTTER_INT_TO_FIXED(0);

  coords[2] = CLUTTER_INT_TO_FIXED(0);
  coords[3] = CLUTTER_INT_TO_FIXED(geom.get_height());

  coords[4] = CLUTTER_INT_TO_FIXED(geom.get_width());
  coords[5] = coords[3];

should be:

  float coords[6];

  // Paint a triangle.  The parent paint call will have translated us into
  // position so paint from 0, 0.
  coords[0] = 0.0;
  coords[1] = 0.0;

  coords[2] = 0.0;
  coords[3] = (float) (geom.get_height());

  coords[4] = (float) (geom.get_width());
  coords[5] = coords[3];

instead.

ciao,
 Emmanuele.

-- 
Emmanuele Bassi, Senior Engineer        | [email protected]
Intel Open Source Technology Center     | http://oss.intel.com

-- 
To unsubscribe send a mail to [email protected]

Reply via email to