Re: [Vala] Compile error when using Cogl.Color



Hi,

2010/3/29 Mike Hordecki <mhordecki gmail com>:
Hello!

I've got a following problem with my the compiler.

Given the code:

   using Cogl;

   void main()
   {
       var color = Color();
   }

valac generates an incorrect constructor call, i.e.
cogl_color_new(&some_temp_var)
as opposed to cogl_color_new() which is present in the cogl's header file.
The vapi presents Cogl.Color as a struct, and this is the way to
initialize structs. A workaround (completely untested, may complain
about uninitialized variable):

    Color color;
    color.set_from_4ub(...);

Looking at the documentation, it seems to me that Color should be a
class. I wonder why it is a struct.

This results in compile error. I've tested this both in 7.10 bundled
with Arch Linux and in HEAD from master. Am I'm missing something?
You can try to remove is_value_type="1" from cogl-1.0.metadata and
regenerate the vapi and see if it's better. (by actually using it, not
by relying on this simple example).

HTH,
Abderrahim



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]