From 3c68908b736716a55fd56a913e270c2b26efe728 Mon Sep 17 00:00:00 2001 From: DaveBy Date: Mon, 21 Jan 2019 21:50:33 +0300 Subject: [PATCH] Add files via upload MSVS compatibility --- tinyraytracer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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];