summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-07-07 01:27:32 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-07-07 01:27:32 (GMT)
commit36e8103a5a09869ce64fd41253280446195c0a0e (patch) (side-by-side diff)
tree5727ca6003df7749a0189c8029c4bc5be053f328
parentd3af5d147163bfb462ea53a61cae2903b2906081 (diff)
downloadexp005-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.c27
-rw-r--r--src/model/map_geometry.h10
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 @@
+#include "map_geometry.h"
+#include "../view/exp004state0.h"
+#include <GL/glut.h>
+
+#define S exp004state0
+
+void
+map_geometry (void)
+{
+ glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE);
+ glPolygonMode (GL_FRONT, GL_FILL);
+
+ for (int i = 0; i < ROWS; i++)
+ {
+ glLoadName (i);
+ glPushMatrix ();
+ glTranslatef (S.base_vertices_data[i][0],
+ S.base_vertices_data[i][1], 0.0);
+ glColor4fv (S.base_colors_data[i]);
+ glCallList (S.list_offset + PROTEIN_GEOMETRY);
+ glPopMatrix ();
+ }
+
+ glEndList ();
+
+ return;
+}
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 @@
+#ifndef MAP_GEOMETRY_H
+#define MAP_GEOMETRY_H
+
+/*
+ * Create the geometry for the map. This includes the geometry for
+ * every point.
+ */
+void map_geometry (void);
+
+#endif // MAP_GEOMETRY_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.