18 files changed, 106 insertions, 47 deletions
diff --git a/src/model/geometry/map_geometry.c b/src/model/geometry/map_geometry.c new file mode 100644 index 0000000..63e409d --- a/dev/null +++ b/src/model/geometry/map_geometry.c | |||
@@ -0,0 +1,40 @@ | |||
1 | #include "map_geometry.h" | ||
2 | #include "../../view/exp004state0.h" | ||
3 | #include <GL/glut.h> | ||
4 | |||
5 | #define S exp004state0 | ||
6 | |||
7 | void | ||
8 | map_geometry (void) | ||
9 | { | ||
10 | glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE); | ||
11 | glPolygonMode (GL_FRONT, GL_FILL); | ||
12 | |||
13 | for (int i = 0; i < ROWS; i++) | ||
14 | { | ||
15 | glLoadName (i); | ||
16 | |||
17 | // Draw the protein geometry. | ||
18 | glPushMatrix (); | ||
19 | glTranslatef (S.base_vertices_data[i][0], | ||
20 | S.base_vertices_data[i][1], 0.0); | ||
21 | glColor4fv (S.base_colors_data[i]); | ||
22 | glCallList (S.list_offset + PROTEIN_GEOMETRY); | ||
23 | glPopMatrix (); | ||
24 | |||
25 | // If the object is selected, draw the selection geometry. | ||
26 | if (S.selection.set[i]) | ||
27 | { | ||
28 | glPushMatrix (); | ||
29 | glTranslatef (S.base_vertices_data[i][0], | ||
30 | S.base_vertices_data[i][1], 0.0); | ||
31 | glColor4f (0.5, 0.5, 0.5, 1.0); | ||
32 | glCallList (S.list_offset + PROTEIN_SELECTED_GEOMETRY); | ||
33 | glPopMatrix (); | ||
34 | } | ||
35 | } | ||
36 | |||
37 | glEndList (); | ||
38 | |||
39 | return; | ||
40 | } | ||