summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@coffee.donpellegrino.com>2009-08-14 19:37:15 (GMT)
committer Don Pellegrino <don@coffee.donpellegrino.com>2009-08-14 19:37:15 (GMT)
commit8de1ddca2733630a20b2663928084d209632d88f (patch) (side-by-side diff)
tree1dd7034d512e8494617f20ab93730aa4145502d8
parent63ef9ec2122cb9ecfc4276b9ec0c84c8e960a0bf (diff)
downloadexp005-8de1ddca2733630a20b2663928084d209632d88f.zip
exp005-8de1ddca2733630a20b2663928084d209632d88f.tar.gz
exp005-8de1ddca2733630a20b2663928084d209632d88f.tar.bz2
Moved loading the data into the initialization routine. This allows for smoother sequence of initializing memory, loading data and then creating the geometry.
-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.