-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (32 loc) · 754 Bytes
/
main.cpp
File metadata and controls
36 lines (32 loc) · 754 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
30
31
32
33
34
35
36
#include "Renderer.hpp"
#include "Lexer.hpp"
int main(int ac, char **av)
{
std::vector<Vertex> vtx2;
std::vector<Vertex> vec;
Vertex p1(400.0, 400.0, 400.0);
Vertex p4(390.0, 390.0, 400.0);
Vertex p2(200.0, 200.0, 200.0);
Vertex p3(600.0, 300.0, 350.0);
Vertex p5(300.0, 300.0, -10.0);
if (ac > 1)
vtx2 = Lexer::readFile(av[1]);
if (ac > 1 && vtx2.empty())
{
std::cerr << "File is not well formated or empty." << std::endl;
return 1;
}
vec.push_back(p1);
vec.push_back(p2);
vec.push_back(p3);
vec.push_back(p4);
vec.push_back(p5);
Renderer renderer;
renderer.init();
if (ac == 1)
renderer.run(vec, 400, 400);
else
renderer.run(vtx2, 400, 400);
renderer.quit();
return (0);
}