author | Don Pellegrino <don@drexel.edu> | 2009-07-07 01:27:32 (GMT) |
---|---|---|
committer | Don Pellegrino <don@drexel.edu> | 2009-07-07 01:27:32 (GMT) |
commit | 36e8103a5a09869ce64fd41253280446195c0a0e (patch) (unidiff) | |
tree | 5727ca6003df7749a0189c8029c4bc5be053f328 | |
parent | d3af5d147163bfb462ea53a61cae2903b2906081 (diff) | |
download | exp005-36e8103a5a09869ce64fd41253280446195c0a0e.zip exp005-36e8103a5a09869ce64fd41253280446195c0a0e.tar.gz exp005-36e8103a5a09869ce64fd41253280446195c0a0e.tar.bz2 |
Moved the map into a single display list in an attempt to improve responsiveness.
-rw-r--r-- | src/model/map_geometry.c | 27 | ||||
-rw-r--r-- | src/model/map_geometry.h | 10 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/model/map_geometry.c b/src/model/map_geometry.c new file mode 100644 index 0000000..31154da --- a/dev/null +++ b/src/model/map_geometry.c | |||
@@ -0,0 +1,27 @@ | |||
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 | glPushMatrix (); | ||
17 | glTranslatef (S.base_vertices_data[i][0], | ||
18 | S.base_vertices_data[i][1], 0.0); | ||
19 | glColor4fv (S.base_colors_data[i]); | ||
20 | glCallList (S.list_offset + PROTEIN_GEOMETRY); | ||
21 | glPopMatrix (); | ||
22 | } | ||
23 | |||
24 | glEndList (); | ||
25 | |||
26 | return; | ||
27 | } | ||
diff --git a/src/model/map_geometry.h b/src/model/map_geometry.h new file mode 100644 index 0000000..f5b6701 --- a/dev/null +++ b/src/model/map_geometry.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef MAP_GEOMETRY_H | ||
2 | #define MAP_GEOMETRY_H | ||
3 | |||
4 | /* | ||
5 | * Create the geometry for the map. This includes the geometry for | ||
6 | * every point. | ||
7 | */ | ||
8 | void map_geometry (void); | ||
9 | |||
10 | #endif // MAP_GEOMETRY_H | ||