some portion of my code where I m getting error,in line 249,252 and 255
void drawTriangle(Particle *p1, Particle *p2, Particle *p3, const Vec3 color)
If the return type of
p1->getNormal().normalized()
is a value, it is a temporary value that doesn't have an address.
However if you store it in a varilable
auto instance = p1->getNormal().normalized();
You can take the address of instance
. If this is a good idea or not depends on if glNormal3fv
expects that pointer to be valid longer than the scope of your function.