View Full Version : Mouse wheel movements with GLUT

24-05-2005, 06:11 PM

I'm a total newbie to OpenGL and GLUT. I found a simple tutorial (a German one, basically just painting a multi-coloured square) and I think I'm getting on top of it. Then I started adding some functionality like being able to translate the image by dragging with the mouse, or rotating it by dragging with the mouse wheel button.. okay, no problems so far.

But then I wanted to be able to zoom the image based on mouse wheel scrolls, and that has proven more difficult. I have done some web searching and it seems that windowing systems handle these events quite differently. I'm under Win32 myself, so top priority would be to get it to work with Win32. Is there a way to do this, perhaps by translating the Windows mouse wheel messages to Linux-style "mouse button 3" and "mouse button 4" events? (I don't have any experience with WinAPI really, and also not much with C/C++, which seems to be what pretty much all code on the WWW is written for.)

What I'm using:
- FPC 2.0.0
- The GL/GLUT headings that came with it
- Windows XP Home

24-05-2005, 08:55 PM
Not sure how how Glut does it, but JEDI-SDL (http://www.sf.net/projects/jedi-sdl ) coupled with OpenGL makes it very easy to handle Input. We have also ported quite a few of the nehe.gamedev.net demos over. It works with FreePascal, Kylix and Delphi with some preliminary support for GNU Pascal as well.