diff -Nru /Volumes/glut/Foreground.c glut/Foreground.c --- /Volumes/glut/Foreground.c 1970-01-01 01:00:00.000000000 +0100 +++ glut/Foreground.c 2006-10-09 13:41:32.000000000 +0200 @@ -0,0 +1,11 @@ +// replacement for Foreground.o + +#include + +void __glutSetForeground(void) { + extern int32_t CPSEnableForegroundOperation( ProcessSerialNumber * PSN ); + ProcessSerialNumber psn; + GetCurrentProcess(&psn); + CPSEnableForegroundOperation(&psn); + SetFrontProcess(&psn); +} diff -Nru /Volumes/glut/GLUTView.m glut/GLUTView.m --- /Volumes/glut/GLUTView.m 2003-08-06 21:16:21.000000000 +0200 +++ glut/GLUTView.m 2006-10-09 13:11:10.000000000 +0200 @@ -1501,6 +1501,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); + } + } +} + /* Left mouse */ - (void)mouseDown: (NSEvent *)theEvent { diff -Nru /Volumes/glut/glut.h glut/glut.h --- /Volumes/glut/glut.h 2003-04-10 20:39:28.000000000 +0200 +++ glut/glut.h 2006-10-09 13:11:10.000000000 +0200 @@ -178,6 +178,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 diff -Nru /Volumes/glut/macx_event.m glut/macx_event.m --- /Volumes/glut/macx_event.m 2003-08-06 21:16:21.000000000 +0200 +++ glut/macx_event.m 2006-10-09 13:11:10.000000000 +0200 @@ -33,13 +33,13 @@ /* ENDCENTRY */ +static void __glutFreeTimer(GLUTTimer *); static void __glutTimerCallBack(CFRunLoopTimerRef timer, GLUTTimer* context) { GLUTtimerCB func = context->func; int value = context->value; __glutProcessWorkEvents(); - static void __glutFreeTimer(GLUTTimer *); __glutFreeTimer(context); if(func)