PDA

View Full Version : Quick GLUT question



02-11-2003, 07:52 AM
In C++ when using GLUT you pass functions as parameters to GLUT functions such as glutMouseFunc(). Is it possible to pass member function of objects to these functions, and if so, what is the syntax? e.g.
class game *mygame=new game();
glutMouseFunc(mygame->mouse);
This does NOT work.

Bob
02-11-2003, 08:13 AM
It it possible to if you make it static. The reason you can't pass a member function is simple; a member function and a "regular" function are different things.