summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--src/controller/exp004mouse.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/controller/exp004mouse.c b/src/controller/exp004mouse.c
index 8e8f986..72791d5 100644
--- a/src/controller/exp004mouse.c
+++ b/src/controller/exp004mouse.c
@@ -1,5 +1,6 @@
1#include "exp004mouse.h"1#include "exp004mouse.h"
2#include "exp004processhits.h"2#include "exp004processhits.h"
3#include "exp004reshape.h"
3#include "../view/exp004geometry.h"4#include "../view/exp004geometry.h"
4#include "../view/exp004state0.h"5#include "../view/exp004state0.h"
5#include "../util/check_error.h"6#include "../util/check_error.h"
@@ -17,10 +18,31 @@ exp004mouse (int button, int state, int x, int y)
17{18{
18 if (button == GLUT_LEFT_BUTTON && state == GLUT_UP)19 if (button == GLUT_LEFT_BUTTON && state == GLUT_UP)
19 {20 {
21 if (S.selecting == true && S.zoom == true)
22 {
23 GLint viewport[4];
24 glGetIntegerv (GL_VIEWPORT, viewport);
25
26 glMatrixMode (GL_PROJECTION);
27 glLoadIdentity ();
28
29 /*
30 * Convert the selection boundary from window coordinates to
31 * world coordinates.
32 */
33
34 gluOrtho2D(-20.0,
35 20.0,
36 -20.0,
37 20.0);
38
39 glutPostRedisplay ();
40 }
41
20 /*42 /*
21 * Complete a selection if one was started and not cancelled.43 * Complete a selection if one was started and not cancelled.
22 */44 */
23 if (S.selecting == true)45 if (S.selecting == true && S.zoom == false)
24 {46 {
25 47
26 /*48 /*
@@ -57,14 +79,6 @@ exp004mouse (int button, int state, int x, int y)
57 GLint viewport[4];79 GLint viewport[4];
58 glGetIntegerv (GL_VIEWPORT, viewport);80 glGetIntegerv (GL_VIEWPORT, viewport);
59 81
60 /*
61 gluPickMatrix ((GLdouble) x,
62 (GLdouble) (viewport[3] - y),
63 N,
64 N,
65 viewport);
66 */
67
68 double c_x = 0.0;82 double c_x = 0.0;
69 double c_y = 0.0;83 double c_y = 0.0;
70 double w = 0.0;84 double w = 0.0;

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.