mirror of
https://github.com/ssloy/tinyraytracer.git
synced 2025-08-13 17:53:58 +02:00
Add files via upload
MSVS compatibility
This commit is contained in:
@@ -3,6 +3,9 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <algorithm>
|
||||||
|
#define _USE_MATH_DEFINES
|
||||||
|
#include <math.h>
|
||||||
#include "geometry.h"
|
#include "geometry.h"
|
||||||
|
|
||||||
struct Light {
|
struct Light {
|
||||||
@@ -134,7 +137,7 @@ void render(const std::vector<Sphere> &spheres, const std::vector<Light> &lights
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::ofstream ofs; // save the framebuffer to file
|
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";
|
ofs << "P6\n" << width << " " << height << "\n255\n";
|
||||||
for (size_t i = 0; i < height*width; ++i) {
|
for (size_t i = 0; i < height*width; ++i) {
|
||||||
Vec3f &c = framebuffer[i];
|
Vec3f &c = framebuffer[i];
|
||||||
|
Reference in New Issue
Block a user