Using the mouse scrollwheel in GLUT

Freeglut’s glutMouseWheelFunc callback is version dependant and not reliable in X. Use standard mouse function and test for buttons 3 and 4. The OpenGlut notes on glutMouseWheelFunc state: Due to lack of information about the mouse, it is impossible to implement this correctly on X at this time. Use of this function limits the portability … Read more

GLUT exit redefinition error

Cause: The stdlib.h which ships with the recent versions of Visual Studio has a different (and conflicting) definition of the exit() function. It clashes with the definition in glut.h. Solution: Override the definition in glut.h with that in stdlib.h. Place the stdlib.h line above the glut.h line in your code. #include <stdlib.h> #include <GL/glut.h>

How to compile for Windows on Linux with gcc/g++?

mingw32 exists as a package for Linux. You can cross-compile and -link Windows applications with it. There’s a tutorial here at the Code::Blocks forum. Mind that the command changes to x86_64-w64-mingw32-gcc-win32, for example. Ubuntu, for example, has MinGW in its repositories: $ apt-cache search mingw […] g++-mingw-w64 – GNU C++ compiler for MinGW-w64 gcc-mingw-w64 – … Read more