-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
69 lines (46 loc) · 1.73 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
//--------------------------------------------------//
// //
// Learning OpenGL: ÅéóáãùãéêÜ ÌáèÞìáôá OpenGL //
// //
// Ðëáôöüñìá áíÜðôõîçò ðáñáäåéãìÜôùí //
// //
// //
// ÌÜèçìá 4ï //
//--------------------------------------------------//
#include <stdio.h> // - Just for some ASCII messages
#include "gl/glut.h" // - An interface and windows
// management library
#include "visuals.h" // Header file for our OpenGL functions
////////////////// State Variables ////////////////////////
float t=0.0; ///Time
/////////////// Main Program ///////////////////////////
int main(int argc, char* argv[])
{
// initialize GLUT library state
glutInit(&argc, argv);
// Set up the display using the GLUT functions to
// get rid of the window setup details:
// - Use true RGB colour mode ( and transparency )
// - Enable double buffering for faster window update
// - Allocate a Depth-Buffer in the system memory or
// in the video memory if 3D acceleration available
glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE);
// Define the main window size and initial position
// ( upper left corner, boundaries included )
glutInitWindowSize(800,800);
glutInitWindowPosition(50,50);
// Create and label the main window
glutCreateWindow("Course3");
// Configure various properties of the OpenGL rendering context
Setup();
// Callbacks for the GL and GLUT events:
// The rendering function
glutDisplayFunc(Render);
glutReshapeFunc(Resize);
glutIdleFunc(Idle);
glutSpecialFunc(processSpecialKeys);
glutKeyboardFunc(processNormalKeys);
//Enter main event handling loop
glutMainLoop();
return 0;
}