diff options
author | Brian Paul <[email protected]> | 2010-03-29 11:44:39 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-03-29 11:47:38 -0600 |
commit | 909f0b356eab04f03389ea36ebf0a83dbb930f5d (patch) | |
tree | 3035fdb7a13072d3a71a6fe85a42ad5774b142db /progs/glsl/fsraytrace.c | |
parent | 8ca937fc3b1bf15c820a1c7d3bf0283a91bec72c (diff) |
progs/glsl: improve the mouse drag/rotate code a little
Diffstat (limited to 'progs/glsl/fsraytrace.c')
-rw-r--r-- | progs/glsl/fsraytrace.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/progs/glsl/fsraytrace.c b/progs/glsl/fsraytrace.c index 357da67b9c6..392f01b200d 100644 --- a/progs/glsl/fsraytrace.c +++ b/progs/glsl/fsraytrace.c @@ -333,6 +333,7 @@ drag(int x, int y) yRot = (float)(y - WinHeight/2) / scale; identity(rot); rotate_xy(rot, yRot, xRot); + glutPostRedisplay(); } } @@ -341,10 +342,7 @@ static void mouse(int button, int state, int x, int y) { - if(state == GLUT_DOWN) - { - mouseGrabbed = !mouseGrabbed; - } + mouseGrabbed = (state == GLUT_DOWN); } @@ -398,7 +396,7 @@ main(int argc, char *argv[]) glutKeyboardFunc(Key); glutDisplayFunc(Draw); glutMouseFunc(mouse); - glutPassiveMotionFunc(drag); + glutMotionFunc(drag); glutIdleFunc(Draw); Init(); glutMainLoop(); |