forked from tharvik/COG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.cpp
59 lines (44 loc) · 1.2 KB
/
Game.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
#include "Game.h"
Game::Game() : univers(), simulator(&univers)
{
glClearColor(BACKGROUND_COLOR);
#ifdef FULLSCREEN
glutFullScreen();
#endif
setSimulator(&simulator);
setUnivers(&univers);
Vvector pos(0, 0, 0);
Vvector addx(10, 0, 0);
Vvector addy(0, 10, 0);
for (int i = 0; i < 48; i++) {
for (int j = 0; j < 48; j++) {
this->univers.addPlanet("Torus", pos);
pos += addx;
}
pos = Vvector(0, pos.y() + addy.y(), pos.z());
}
{
glutIgnoreKeyRepeat(GLUT_KEY_REPEAT_DEFAULT);
glutTimerFunc(KEY_REPEAT_PERIOD, keyboard, 0);
}
{
glutReshapeFunc(windowResizingHandler);
glutWindowStatusFunc(windowStatusHandler);
#ifdef __APPLE__
glutWMCloseFunc(windowClosingHandler);
#endif
glutDisplayFunc(displayHandler);
}
}
void Game::enterMainMenu()
{
glutSpecialFunc(specialKeyDown);
glutKeyboardFunc(keyDown);
glutKeyboardUpFunc(keyUp);
glutMouseFunc(mouseHandler);
glutMotionFunc(motionHandler);
glutIdleFunc(tick);
glutMainLoop();
}
void Game::enterPauseMenu()
{}