riley-harper / RayTracer

Code for a raytracer that I built in spring 2021, along with example images!
0 stars 0 forks source link

`M_PI` Constant Causes Issues on Windows #32

Closed riley-harper closed 3 years ago

riley-harper commented 3 years ago

I was actually able to build and run the project with Visual Studio 2019 on Windows without many issues. The only error I got while building is that M_PI isn't a recognized constant on Windows.

This constant is used in ViewFrame.cpp. It holds the value of pi, so we could probably just do something like

#ifdef WIN32
#define M_PI 3.14159...
#endif
riley-harper commented 3 years ago

Better:

#ifndef M_PI
#define M_PI 3.14159...
#endif