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






Date: Wed, 31 Mar 2010 10:43:29 +0100
From: a kitouni gmail com
To: mhordecki gmail com
CC: vala-list gnome org
Subject: 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(...);

I've always used it as

Color c = {0, 0, 0, 0};
where each zero is red, green, blue and alpha respectively

Sam
                                          


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