An annoying compile issue

Rikki Cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 25 20:51:10 PDT 2015


On 26/10/15 4:44 PM, WhatMeWorry wrote:
> I'm porting over some C++/glm/openGL code.  I've used gl3n for a while
> now (successfully) to port over glm code, but I've got this pebble in my
> shoe:
>
> glm::mat4 model;
> model = glm::scale(model, glm::vec3(size, 1.0f));   // size is a vec2
>
> So my D code consists of:
>
> mat4 model;
> model = model.scale(vec3(size, 1.0f));  // size is a vec2
>
>
> Error: function gl3n.linalg.Matrix!(float, 4, 4).Matrix.scale (float x,
> float y, float z) is not callable using argument types (Vector!(float, 3))
>
>
> First, isn't Vector!(float,3) a template which creates a tuple
> consisting of float, float, float; so aren't the argument types identical?

It is not a tuple.
vec2 != vec3. They are different types altogether.


More information about the Digitalmars-d-learn mailing list