diff --git a/tinyraytracer.cpp b/tinyraytracer.cpp index 16d8bb1..d065709 100644 --- a/tinyraytracer.cpp +++ b/tinyraytracer.cpp @@ -3,6 +3,9 @@ #include #include #include +#include +#define _USE_MATH_DEFINES +#include #include "geometry.h" struct Light { @@ -134,7 +137,7 @@ void render(const std::vector &spheres, const std::vector &lights } std::ofstream ofs; // save the framebuffer to file - ofs.open("./out.ppm"); + ofs.open("./out.ppm",std::ios::binary); ofs << "P6\n" << width << " " << height << "\n255\n"; for (size_t i = 0; i < height*width; ++i) { Vec3f &c = framebuffer[i];