-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cpp
69 lines (38 loc) · 1.01 KB
/
Main.cpp
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
60
61
62
63
64
65
66
67
68
69
#include <iostream>
#include "Vars.h"
#include <thread>
#include <vector>
#include <array>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
void drawLoop();
void calcLoop();
void futureCalcLoop();
std::vector<Body> bodies;
std::vector<std::array<int, 2>> futurePos;
bool running = true;
int main() {
std::thread t1(drawLoop);
std::thread t2(calcLoop);
std::thread t3(futureCalcLoop);
t1.join();
t2.join();
t3.join();
return 0;
}
/*
forcelines
*/
/*
Code Graveyard
void drawCircle(float cx, float cy, float r, int num_segments) {
glBegin(GL_LINE_LOOP);
for (int ii = 0; ii < num_segments; ii++) {
float theta = 2.0f * 3.1415926f * float(ii) / float(num_segments);//get the current angle
float x = r * cosf(theta);//calculate the x component
float y = r * sinf(theta);//calculate the y component
glVertex2f(x + cx, y + cy);//output vertex
}
glEnd();
}
*/