I am using DirectX 11 and trying to load variables locally in scope using XMLoadFloat4. I am doing a lot of it and names are pretty long so I don't want to create bunch of local variables, however with code like this:
XMStoreFloat4(&vertices[0].normal, XMVector3Cross(
XMLoadFloat4(&(vertices[2].position - vertices[0].position)),
XMLoadFloat4(&(vertices[0].position - vertices[1].position))
));
I'm getting C2102. Do you know elegant way to create reference in place like this?
auto a = vertices[2].position - vertices[0].position;
andauto b = vertices[0].position - vertices[1].position;
and then call it with&a, &b
. – Coexecutor