summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-06-18 21:14:58 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-06-18 21:14:58 (GMT)
commit4b6435015ab3185eb9d751c3bb2e43c10e9ccf22 (patch) (side-by-side diff)
tree99dab6b9ecfa4496c58f895b5f78b395421bbd4d
parent6600093d06fc302a13ffdde193dbe4b8da151d9c (diff)
downloadexp005-4b6435015ab3185eb9d751c3bb2e43c10e9ccf22.zip
exp005-4b6435015ab3185eb9d751c3bb2e43c10e9ccf22.tar.gz
exp005-4b6435015ab3185eb9d751c3bb2e43c10e9ccf22.tar.bz2
Implemented zooming.
-rw-r--r--src/controller/selection_from_db.sqc20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/controller/selection_from_db.sqc b/src/controller/selection_from_db.sqc
index 9467ab3..8a49510 100644
--- a/src/controller/selection_from_db.sqc
+++ b/src/controller/selection_from_db.sqc
@@ -1,9 +1,10 @@
#define GL_GLEXT_PROTOTYPES
#include "selection_from_db.h"
#include "../view/exp004state0.h"
+#include "../util/check_error.h"
#include <GL/glut.h>
-
-EXEC SQL INCLUDE sqlca;
+#include "sqlca.h"
+extern struct sqlca sqlca;
/*
* A simple alias to make the code more readable.
@@ -25,6 +26,7 @@ selection_from_db (void)
ORDER BY title, id DESC;
EXEC SQL OPEN c3;
+ check_error (__FILE__, __LINE__);
/*
* This loop currently assumes only one set in the table and does
@@ -34,18 +36,22 @@ selection_from_db (void)
EXEC SQL FETCH c3 INTO :vis_sel_set;
while (sqlca.sqlcode != 100)
{
- S.selection[vis_sel_set.id] = true;
- S.base_colors_data[vis_sel_set.id][0] = vis_sel_set.r;
- S.base_colors_data[vis_sel_set.id][1] = vis_sel_set.g;
- S.base_colors_data[vis_sel_set.id][2] = vis_sel_set.b;
- S.base_colors_data[vis_sel_set.id][3] = 0.6;
+ int i = vis_sel_set.id - 1;
+
+ S.selection.set[i] = true;
+ S.base_colors_data[i][0] = vis_sel_set.r;
+ S.base_colors_data[i][1] = vis_sel_set.g;
+ S.base_colors_data[i][2] = vis_sel_set.b;
+ S.base_colors_data[i][3] = 0.6;
EXEC SQL FETCH c3 INTO :vis_sel_set;
}
EXEC SQL CLOSE c3;
+ check_error (__FILE__, __LINE__);
EXEC SQL COMMIT;
+ check_error (__FILE__, __LINE__);
/*
* Update the graphics memory.

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.