-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
145 lines (132 loc) · 4.19 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// ********************* INCLUDES *********************
#include "Chapters/Exercises.h"
// ********************* MAIN PROGRAM *********************
int main()
{
bool quit = false;
int response = -1;
while (!quit)
{
std::cout << "\n********************* MENU *********************\n";
std::cout << "\nHello triangle chapter:\n";
std::cout << "0) Hello triangle!\n";
std::cout << "1) Exercise 1\n";
std::cout << "2) Exercise 2\n";
std::cout << "3) Exercise 3\n";
std::cout << "\nShader chapter:\n";
std::cout << "\n4) Shader with uniform variables\n";
std::cout << "5) Coloured vertices\n";
std::cout << "6) Shader class implementation\n";
std::cout << "7) Ex 1: Upside down triangle shader\n";
std::cout << "8) Ex 2: Shader with horizontal offset\n";
std::cout << "9) Ex 3: Fragment colour equal to vertex position\n";
std::cout << "\nTextures chapter:\n";
std::cout << "\n10) Texture base implementation\n";
std::cout << "11) Multiple textures\n";
std::cout << "12) Ex 1: Multiple textures with happy face reversed\n";
std::cout << "13) Ex 2: Multiple textures with multiple happy faces\n";
std::cout << "14) Ex 3: Multiple textures with variable display\n";
std::cout << "\nTransformations chapter:\n";
std::cout << "\n15) Transformations base implementation\n";
std::cout << "16) Ex 1: Reversed transformation procedure\n";
std::cout << "17) Ex 2: Multiple transformations\n";
std::cout << "\nCoordinate Systems chapter:\n";
std::cout << "\n18) Coordinate Systems base implementation\n";
std::cout << "19) Coordinate Systems cube implementation\n";
std::cout << "20) Coordinate Systems multiple rotating cube implementation\n";
std::cout << "\nCamera chapter:\n";
std::cout << "\n21) Camera base implementation\n";
std::cout << "22) Camera walk around implementation\n";
std::cout << "\n23) Quit\n";
std::cout << "\nOption:";
std::cin >> response;
switch (response)
{
case 0:
Base();
break;
case 1:
Exercise1();
break;
case 2:
Exercise2();
break;
case 3:
Exercise3();
break;
case 4:
BaseUniformShader();
break;
case 5:
ColouredVertex();
break;
case 6:
ShaderClassImplementation();
break;
case 7:
ShaderExercise1();
break;
case 8:
float offset;
std::cout << "\nEnter a horizontal offset:";
std::cin >> offset;
// Perform with set offset
ShaderExercise2(offset);
break;
case 9:
ShaderExercise3();
break;
case 10:
TexturesBase();
break;
case 11:
TextureUnits();
break;
case 12:
TextureExercise1();
break;
case 13:
TextureExercise2();
break;
case 14:
float disp_val;
std::cout << "\nEnter texture display value:";
std::cin >> disp_val;
// Perform with set texture display value
TextureExercise4(disp_val);
break;
case 15:
TransformationBase();
break;
case 16:
TransformationsExercise1();
break;
case 17:
TransformationsExercise2();
break;
case 18:
CoordinateSystemsBase();
break;
case 19:
CoordinateSystemsBaseCube();
break;
case 20:
CoordinateSystemsMultipleCubes();
break;
case 21:
CameraBaseImplementation();
break;
case 22:
CameraWalkAroundImplementation();
break;
case 23:
quit = true;
break;
default:
Base();
break;
}
}
std::cout << "\nGood-bye!";
return 0;
}