I have sent the code to the FreeGLUT developers, in the hope that they will include it in future versions and they will add OSX support.
In practice, I have implemented two call-backs that were void in the original libraries:
Code: Select all
void glutSpaceballButtonFunc(int button, int state);
Code: Select all
void glutSpaceballMotionFunc(int tx, int ty, int tz, int rx, int ry, int rz);
Code: Select all
#include <GL>
#include <stdio>
void sbButton(int button, int state)
{
printf("%d, %d\n", button, state);
}
void sbMotion(int tx, int ty, int tz, int rx, int ry, int rz)
{
printf("%d, %d, %d, %d, %d, %d\n", tx, ty, tz, rx, ry, rz);
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (500, 500);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
glutSpaceballButtonFunc (sbButton);
glutSpaceballMotionFunc (sbMotion);
glutMainLoop();
return 0;
}