-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
55 lines (42 loc) · 1.27 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
/*
* Semestral project for subject Y36PGR (Graphics programming).
* Author: Tomas Cerevka
*
* Created on March 26, 2011, 2:10 PM
*/
#include <cstdlib>
#include <iostream>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/freeglut.h>
#include "Enviroment.h"
using namespace std;
/**
* Enter point.
* @param argc Count of arguments.
* @param argv Arguments.
* @return Return value.
*/
int main(int argc, char** argv) {
Environment * environment = Environment::getInstance();
// Initialize the GLUT library.
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutInitWindowPosition(5, 5);
glutInitWindowSize(environment->windowWidth, environment->windowHeight);
// Create main window and set up callbacks.
glutCreateWindow(environment->windowTitle.c_str());
glutDisplayFunc(Environment::display);
glutReshapeFunc(Environment::reshape);
glutKeyboardFunc(Environment::keyboard);
glutSpecialFunc(Environment::specialKeyboard);
glutMouseFunc(Environment::mouse);
glutMotionFunc(Environment::mouseMotion);
glutIdleFunc(Environment::idle);
environment->createMenu();
environment->init();
// Start main loop.
glutMainLoop();
delete environment;
return 0;
}