-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (50 loc) · 1.34 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
#include <GL/glew.h>
#ifdef __APPLE__
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#endif
#ifdef __gnu_linux__
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#include <GL/glut.h>
#include <glm/glm.hpp>
#include <stdlib.h>
#include <iostream>
#include <vector>
#include "helpers.hpp"
#include "Camera.hpp"
#include "ODE.hpp"
#include "display.hpp"
#include "callbacks.hpp"
#include "shader.hpp"
#include "globals.hpp"
using namespace std;
int main(int argc, char* argv[])
{
// Initialisation
glutInit(&argc, argv);
glutInitWindowPosition(1920/8, 1080/8);
glutInitWindowSize(1920/2, 1080/2);
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("Otus");
glewInit();
glClearColor(0.259, 0.525, 0.957, 1.0);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
GLuint vertexshader = compileShader(GL_VERTEX_SHADER, "shaders/vert.glsl");
GLuint fragmentshader = compileShader(GL_FRAGMENT_SHADER, "shaders/frag.glsl");
shaderprogram = initProgram(vertexshader, fragmentshader);
help();
// callback functions
glutKeyboardFunc(keyboard);
glutDisplayFunc(display);
glutSpecialFunc(SpecialInput);
glutMouseFunc(mouse);
glutMotionFunc(motion);
glutPassiveMotionFunc(passiveMotion);
glutReshapeFunc(reshape);
glutIdleFunc(display);
glutMainLoop();
return 0;
}