author | Don Pellegrino <don@drexel.edu> | 2009-06-18 21:12:35 (GMT) |
---|---|---|
committer | Don Pellegrino <don@drexel.edu> | 2009-06-18 21:12:35 (GMT) |
commit | 816589d55b274c58425900e7cafd0288fe85c861 (patch) (unidiff) | |
tree | 5db63c511bb9d8c591b659df50f853b58534b9e6 | |
parent | 906ded217057bb47ee776f09daecdf683a4dca6f (diff) | |
download | exp005-816589d55b274c58425900e7cafd0288fe85c861.zip exp005-816589d55b274c58425900e7cafd0288fe85c861.tar.gz exp005-816589d55b274c58425900e7cafd0288fe85c861.tar.bz2 |
Implemented zooming.
-rw-r--r-- | src/controller/set_ortho.c | 26 | ||||
-rw-r--r-- | src/controller/set_ortho.h | 11 |
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 @@ | |||
1 | #include "set_ortho.h" | ||
2 | #include "../view/exp004state0.h" | ||
3 | #include <GL/glut.h> | ||
4 | |||
5 | #define S exp004state0 | ||
6 | |||
7 | void | ||
8 | set_ortho (void) | ||
9 | { | ||
10 | if (S.zoom.active) | ||
11 | { | ||
12 | gluOrtho2D (S.zoom.coords[0], | ||
13 | S.zoom.coords[1], | ||
14 | S.zoom.coords[2], | ||
15 | S.zoom.coords[3]); | ||
16 | } | ||
17 | else | ||
18 | { | ||
19 | gluOrtho2D (S.ortho.min_x, | ||
20 | S.ortho.max_x, | ||
21 | S.ortho.min_y, | ||
22 | S.ortho.max_y); | ||
23 | } | ||
24 | |||
25 | return; | ||
26 | } | ||
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 @@ | |||
1 | #ifndef SET_ORTHO_H | ||
2 | #define SET_ORTHO_H | ||
3 | |||
4 | /* | ||
5 | * The same orthographic project should be used when in selection or | ||
6 | * rendering mode. This function breaks the logic into a single | ||
7 | * location so that it can be call from code for either mode. | ||
8 | */ | ||
9 | void set_ortho (void); | ||
10 | |||
11 | #endif // SET_ORTHO_H | ||