aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2020-12-20 01:18:38 +0100
committerladevieq <ladevie.quentin@gmail.com>2020-12-20 01:18:38 +0100
commit2d8e108dd6811bcf55bed28f1855a36077f8c674 (patch)
tree4f4c33f79322b1f8074b3a2c5ec15d7b81cb2c26 /src/main.cpp
parent0aabf36c6bf5aa68846d055e310171da5b2b8859 (diff)
Add vector class
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 2cd66a9..8049bac 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,5 +1,8 @@
#include <iostream>
+#include "color.hpp"
+#include "vec3.hpp"
+
int main() {
size_t width = 256;
size_t height = 256;
@@ -22,12 +25,8 @@ int main() {
auto r = double(column) / (width-1);
auto g = double(row) / (height-1);
auto b = 0.25;
-
- int ir = static_cast<int>(255.999 * r);
- int ig = static_cast<int>(255.999 * g);
- int ib = static_cast<int>(255.999 * b);
-
- std::cout << ir << ' ' << ig << ' ' << ib << '\n';
+ color c(r, g, b);
+ write_color(std::cout, c);
}
}