FreeGLUT spaceball patch

The original GLUT library used to support some less well-known input devices under IRIX, such as the Spaceball, a true 3D input device which can be used to control all 6 degrees of freedom (3 axis of rotation and 3 axis of translation) simultaneously. Unfortunately, nowadays, the more “exotic” input callbacks of GLUT such as the spaceball are left unimplemented.

So, yesterday I sat down and implemented the missing spaceball bits of FreeGLUT, which is the most widely used free GLUT implementation.

To avoid adding any extra dependencies to freeglut, I just ripped the relevant code from libspnav, which is part of my free spacenav driver project, and added it directly into freeglut.

Here’s the patch against the current freeglut svn head, as well as instructions on how to check out freeglut and apply it.

I’ve also submitted it to the freeglut-devel mailing list, so hopefully they’ll merge it and we’ll have spaceball input callbacks available with the prepackaged glut that comes with any GNU/Linux distribution in the future.


3 Responses to “FreeGLUT spaceball patch”

  1. Guillaume Riviere Says:


    Thank you so much !!! I want to develop a GLUT application under Debian Lenny and to use the SpacePilot of 3D Connexions.

    Then i needed the 3 functions glutSpaceballButtonFunc(), glutSpaceballMotionFunc () and glutSpaceballRotateFunc (), which are not (yet) implemented in FreeGLUT.

    Current version is 833, the command to download should now be:

    svn co -r 832

    Thanks again for your great work ! Hope FreeGLUT will add your patch to official version.


  2. Guillaume Riviere Says:

    1) On this page
    you should precise that the patch must be copied and applied in the “freeglut” directory (obtained from svn)

    2) The command “make install” installs freeglut in /usr/local/
    then -I /usr/local/include must be added to gcc or g++

  3. Nuclear Says:

    The patch has been commited to the freeglut subversion repository (rev 837 and up), and should make it into the next freeglut 2.6.0 release (which I understand should be out shortly).

    Btw, where freeglut is installed can be controlled by passing the –prefix=/what/ever/path argument to the configure script. However /usr/local/include should be in the default search path. At least it is on my system.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: