-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
52 lines (46 loc) · 1.21 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
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <iostream>
#include <vector>
#include "tinyxml2/tinyxml2.h"
#include "sources/forma.h"
#include "sources/funcoes.h"
#include "sources/janela.h"
#include "sources/retangulo.h"
#include "sources/circulo.h"
#include "sources/carro.h"
#include "sources/camera.h"
using namespace tinyxml2;
using namespace std;
//Global variables
Janela MainWindow;
list<Carro> enemies;
Circulo arena[2];
Retangulo rect;
Carro player;
Camera camera;
list<Tiro> playerShots, enemiesShots;
int key_status[256] = {0};
int main(int argc, char** argv)
{
readXMLFile(argv[1]);
srand(time(NULL));
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(MainWindow.getWidth(),MainWindow.getHeight()+200);
glutInitWindowPosition(500,500);
glutCreateWindow(MainWindow.getTitle().c_str());
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutSpecialFunc(specialFunc);
glutPassiveMotionFunc(passiveMouse);
glutMotionFunc(motionMouse);
glutMouseFunc(mouse);
glutKeyboardFunc(keypress);
glutKeyboardUpFunc(keyUp);
glutIdleFunc(idle);
glutMainLoop();
return EXIT_SUCCESS;
}