-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (28 loc) · 717 Bytes
/
main.cpp
File metadata and controls
29 lines (28 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "util.hpp"
#include "color.hpp"
#include "surface.hpp"
#include "scene.hpp"
#include "sphere.hpp"
#include "triangle.hpp"
#include "light.hpp"
#include "stl_loader.hpp"
#include "rt_loader.hpp"
#include <time.h>
#include <cstring>
int main(int argc, char* argv[])
{
Scene s;
if (argc >= 2) {
if (argv[1][strlen(argv[1]) - 1] == 't') {
RTLoader loader;
loader.populate(s, argv[1]);
} else {
STLLoader::populate(s, argv[1]);
}
//s.add_object(new Sphere(Color(1, 0, 0), Point(0, 0, 0), 1));
//s.add_light(Light{Point(-1, -0.5, 0.5), Color()});
//s.prepare();
}
Surface sf(s, 1024, 768);
sf.event_loop();
}