summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-06-18 21:12:35 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-06-18 21:12:35 (GMT)
commit816589d55b274c58425900e7cafd0288fe85c861 (patch) (side-by-side diff)
tree5db63c511bb9d8c591b659df50f853b58534b9e6
parent906ded217057bb47ee776f09daecdf683a4dca6f (diff)
downloadexp005-816589d55b274c58425900e7cafd0288fe85c861.zip
exp005-816589d55b274c58425900e7cafd0288fe85c861.tar.gz
exp005-816589d55b274c58425900e7cafd0288fe85c861.tar.bz2
Implemented zooming.
-rw-r--r--src/controller/set_ortho.c26
-rw-r--r--src/controller/set_ortho.h11
2 files changed, 37 insertions, 0 deletions
diff --git a/src/controller/set_ortho.c b/src/controller/set_ortho.c
new file mode 100644
index 0000000..75af6a6
--- a/dev/null
+++ b/src/controller/set_ortho.c
@@ -0,0 +1,26 @@
+#include "set_ortho.h"
+#include "../view/exp004state0.h"
+#include <GL/glut.h>
+
+#define S exp004state0
+
+void
+set_ortho (void)
+{
+ if (S.zoom.active)
+ {
+ gluOrtho2D (S.zoom.coords[0],
+ S.zoom.coords[1],
+ S.zoom.coords[2],
+ S.zoom.coords[3]);
+ }
+ else
+ {
+ gluOrtho2D (S.ortho.min_x,
+ S.ortho.max_x,
+ S.ortho.min_y,
+ S.ortho.max_y);
+ }
+
+ return;
+}
diff --git a/src/controller/set_ortho.h b/src/controller/set_ortho.h
new file mode 100644
index 0000000..4e95330
--- a/dev/null
+++ b/src/controller/set_ortho.h
@@ -0,0 +1,11 @@
+#ifndef SET_ORTHO_H
+#define SET_ORTHO_H
+
+/*
+ * The same orthographic project should be used when in selection or
+ * rendering mode. This function breaks the logic into a single
+ * location so that it can be call from code for either mode.
+ */
+void set_ortho (void);
+
+#endif // SET_ORTHO_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.