From 8f889f22d854704ea4f472bb950daf2fdb15385b Mon Sep 17 00:00:00 2001 From: Don Pellegrino Date: Tue, 16 Jun 2009 23:23:48 +0000 Subject: Added zoom feature - current incomplete. --- 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 @@ #include "exp004mouse.h" #include "exp004processhits.h" +#include "exp004reshape.h" #include "../view/exp004geometry.h" #include "../view/exp004state0.h" #include "../util/check_error.h" @@ -17,10 +18,31 @@ exp004mouse (int button, int state, int x, int y) { if (button == GLUT_LEFT_BUTTON && state == GLUT_UP) { + if (S.selecting == true && S.zoom == true) + { + GLint viewport[4]; + glGetIntegerv (GL_VIEWPORT, viewport); + + glMatrixMode (GL_PROJECTION); + glLoadIdentity (); + + /* + * Convert the selection boundary from window coordinates to + * world coordinates. + */ + + gluOrtho2D(-20.0, + 20.0, + -20.0, + 20.0); + + glutPostRedisplay (); + } + /* * Complete a selection if one was started and not cancelled. */ - if (S.selecting == true) + if (S.selecting == true && S.zoom == false) { /* @@ -57,14 +79,6 @@ exp004mouse (int button, int state, int x, int y) GLint viewport[4]; glGetIntegerv (GL_VIEWPORT, viewport); - /* - gluPickMatrix ((GLdouble) x, - (GLdouble) (viewport[3] - y), - N, - N, - viewport); - */ - double c_x = 0.0; double c_y = 0.0; double w = 0.0; -- cgit v0.8.3.1-22-g547a