summaryrefslogtreecommitdiffstats
Side-by-side diff
-rw-r--r--src/view/exp004init.c15
-rw-r--r--src/view/exp004view.c2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/view/exp004init.c b/src/view/exp004init.c
index 30d8d96..5a6ddd0 100644
--- a/src/view/exp004init.c
+++ b/src/view/exp004init.c
@@ -6,6 +6,7 @@
#include "../model/geometry/protein_selected_geometry.h"
#include "../model/selection_info_init.h"
#include "../model/zoom_info_init.h"
+#include "../model/exp004base.h"
#include <GL/glut.h>
#define S exp004state0
@@ -13,10 +14,24 @@
void
exp004init (void)
{
+ /*
+ * Initialize default values, zero memory and NULL pointers.
+ */
+ S.rows = 0;
+ S.base_vertices_data = NULL;
+ S.base_colors_data = NULL;
selection_info_init (&S.selection);
zoom_info_init (&S.zoom);
S.legend = true;
+ /*
+ * Load the data.
+ */
+ exp004base ();
+
+ /*
+ * Create the geometry based on the data.
+ */
S.list_offset = glGenLists (NUM_LISTS);
protein_geometry ();
protein_selected_geometry ();
diff --git a/src/view/exp004view.c b/src/view/exp004view.c
index 33198ad..92cb56e 100644
--- a/src/view/exp004view.c
+++ b/src/view/exp004view.c
@@ -3,7 +3,6 @@
#include "../controller/exp004reshape.h"
#include "../controller/keyboard.h"
#include "../db/dbconnect.h"
-#include "../model/exp004base.h"
#include "exp004init.h"
#include "exp004state0.h"
#include "exp004view.h"
@@ -40,7 +39,6 @@ exp004view (void)
glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
// Initialize the model.
- exp004base ();
exp004init ();
// Callbacks (Controllers)

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.