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) (unidiff)
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 @@
6#include "../model/geometry/protein_selected_geometry.h"6#include "../model/geometry/protein_selected_geometry.h"
7#include "../model/selection_info_init.h"7#include "../model/selection_info_init.h"
8#include "../model/zoom_info_init.h"8#include "../model/zoom_info_init.h"
9#include "../model/exp004base.h"
9#include <GL/glut.h>10#include <GL/glut.h>
1011
11#define S exp004state012#define S exp004state0
@@ -13,10 +14,24 @@
13void14void
14exp004init (void)15exp004init (void)
15{16{
17 /*
18 * Initialize default values, zero memory and NULL pointers.
19 */
20 S.rows = 0;
21 S.base_vertices_data = NULL;
22 S.base_colors_data = NULL;
16 selection_info_init (&S.selection);23 selection_info_init (&S.selection);
17 zoom_info_init (&S.zoom);24 zoom_info_init (&S.zoom);
18 S.legend = true;25 S.legend = true;
1926
27 /*
28 * Load the data.
29 */
30 exp004base ();
31
32 /*
33 * Create the geometry based on the data.
34 */
20 S.list_offset = glGenLists (NUM_LISTS);35 S.list_offset = glGenLists (NUM_LISTS);
21 protein_geometry ();36 protein_geometry ();
22 protein_selected_geometry ();37 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 @@
3#include "../controller/exp004reshape.h"3#include "../controller/exp004reshape.h"
4#include "../controller/keyboard.h"4#include "../controller/keyboard.h"
5#include "../db/dbconnect.h"5#include "../db/dbconnect.h"
6#include "../model/exp004base.h"
7#include "exp004init.h"6#include "exp004init.h"
8#include "exp004state0.h"7#include "exp004state0.h"
9#include "exp004view.h"8#include "exp004view.h"
@@ -40,7 +39,6 @@ exp004view (void)
40 glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);39 glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
4140
42 // Initialize the model.41 // Initialize the model.
43 exp004base ();
44 exp004init ();42 exp004init ();
4543
46 // Callbacks (Controllers)44 // Callbacks (Controllers)

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.