-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
59 lines (48 loc) · 1.34 KB
/
main.cpp
File metadata and controls
59 lines (48 loc) · 1.34 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* https://github.com/plastictown/Engine
* Copyright (C) 2018 Mikhail Domchenkov
* agplastictown@yandex.ru
*/
#include <iostream>
#include <vector>
#include <memory>
#include <utility>
#include <exception>
#include <thread>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/freeglut.h>
#include <engine.h>
#include <SceneLoader.h>
#include <polygon.h>
#include <vertex.h>
#include <vertex2f.h>
#include <vertex2fc.h>
#include <color.h>
#include <rect.h>
using namespace std;
int main(int argc, char** argv) try {
Engine e(argc, argv);
vertex2f v{1,5};
vertex2f vv(2,3);
polygon<float, 2> p{};
p.addVertex(vertex2f{0,0});
p.addVertex(vertex2f{0,10});
p.addVertex(vertex2f{10,10});
p.addVertex(vertex2f{10,0});
std::cout << p.pointInPolygon(vertex2f{-1,-1}) << endl;
std::cout << p.pointInPolygon(vertex2f{1,1}) << endl;
std::cout << "size = " << p.size() << std::endl;
//-------------------------------------------------------------//
std::shared_ptr<Scene> scn = std::make_shared<Scene>();
scn->setVisible(true);
e.SetScene(std::move(scn));
Engine::Run();
//cin.get();
return 0;
} catch(std::exception& e) {
std::cerr << __FUNCTION__ << ": " << e.what() << std::endl;
return -1;
} catch(...) {
std::cerr << __FUNCTION__ << ": unknown exception" << std::endl;
}