diff -ru /Volumes/glut/GLUTView.m glut/GLUTView.m --- /Volumes/glut/GLUTView.m 2008-02-08 19:47:22.000000000 +0100 +++ glut/GLUTView.m 2008-03-06 09:32:40.000000000 +0100 @@ -1748,6 +1748,29 @@ } } +/* scroll wheel handling */ +- (void)scrollWheel: (NSEvent *)theEvent +{ + if(_mouseFunc) { + NSPoint location = [self convertPoint: [theEvent locationInWindow] fromView: nil]; + float deltaY = [theEvent deltaY]; + int buttonID = GLUT_WHEEL_UP; + if(deltaY < 0) { + deltaY = -deltaY; + buttonID = GLUT_WHEEL_DOWN; + } + int x = rint(location.x); + int y = rint(location.y); + + __glutSetWindow(self); + int i; + for(i = 0; i < deltaY; i++) { +// (*_mouseFunc)(buttonID, GLUT_DOWN, x, y); + (*_mouseFunc)(buttonID, GLUT_UP, x, y); + } + } +} + - (BOOL)validateMenuItem: (NSMenuItem *)menuItem { /* User is about to start a menu tracking session. We install a special diff -ru /Volumes/glut/glut.h glut/glut.h --- /Volumes/glut/glut.h 2008-02-08 19:47:22.000000000 +0100 +++ glut/glut.h 2008-03-06 09:28:43.000000000 +0100 @@ -181,6 +181,8 @@ #define GLUT_LEFT_BUTTON 0 #define GLUT_MIDDLE_BUTTON 1 #define GLUT_RIGHT_BUTTON 2 +#define GLUT_WHEEL_UP 3 +#define GLUT_WHEEL_DOWN 4 /* Mouse button state. */ #define GLUT_DOWN 0