rhencke/glut — pull request #5 by rick-monster (2014-05-08 14:17:17+00:00)
Title: Force 32 bit so mouse left of screen negative

Hi came across what seems like a bug in the glut library.

On ubuntu 12.04 32bit all features I've tested work fine with freeglut3-dev package

On ubuntu 10.04 64bit with freeglut3-dev=2.6.0-0ubuntu2 I came across following problem, whilst working towards a serverless network pong type game ( github.com/rick-monster/gopong ):

-set up a mouse callback with glut.MotionFunc(motion)
-you click and drag, then go to the left of the window
-instead of a small negative number of pixels it wraps to 2**31
-this led me to believe that for whatever reason glut is passing a 32 bit signed int to the go code.
-the hack posted here fixes the problem.

I guess there must be a better way? I'm just getting started with go so I don't know how to resolve this issue cleanly!