On Saturday, 2 May 2015 at 22:01:10 UTC, WhatMeWorry wrote:
    struct Vertex
    {
        vec3 position;
        vec3 color;
    }

    Vertex triangle[6] =
    [
        vec3(0.0,  1.0, 0.0),
        vec3(1.0,  0.0, 0.0),   // red

       // code removed for brevity.
    ];

I keep getting the following:

MeGlWindow.d(171): Error: cannot implicitly convert expression (Vector([0.000000F, 1.00000F, 0.000000F])) of type Vector!(float, 3) to Vertex

You have to be explicit:

    Vertex[6] triangle = /* [1] */
    [
        Vertex(
            vec3(0.0,  1.0, 0.0),
            vec3(1.0,  0.0, 0.0),   // red
        ),
        ...
    ];

[1] `Vertex triangle[6]` works, but please don't do that.

Reply via email to