-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathengine.cpp
More file actions
26 lines (24 loc) · 803 Bytes
/
engine.cpp
File metadata and controls
26 lines (24 loc) · 803 Bytes
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
// g++ engine.cpp -lglut -lGL -lGLU -lSDL -o ddd
// g++ engine.cpp -lglut -lGL -o ddd also works
// dependencies: mesa-common-dev and freeglut3-dev
#include "lib3d.cpp"
int main(int argc, char** argv) {
square = new polygon;
polygonColor(square, 1.0f, 0.0f, 0.0f);
addVertex(square, 0.0f, 10.0f, 0.0f);
addVertex(square, 0.6f, 10.0f, 0.0f);
addVertex(square, 0.6f, 10.0f, 0.6f);
addVertex(square, 0.0f, 10.0f, 0.6f);
square2 = new polygon;
polygonColor(square2, 0.0f, 0.0f, 1.0f);
addVertex(square2, 0.0f, 10.6f, 0.0f);
addVertex(square2, 0.6f, 10.6f, 0.0f);
addVertex(square2, 0.6f, 10.6f, 0.6f);
addVertex(square2, 0.0f, 10.6f, 0.6f);
glutInit(&argc, argv);
initGL();
glutMainLoop();
destroyPolygon(square);
destroyPolygon(square2);
return 0;
}