I have written a small C++ class to be used with GLUT which has some member functions that I am attempting to use as the keyboard callbacks. When I try to compile I get the error:
C2664: ‘glutKeyboardFunc’ : cannot convert parameter 1 from ‘void (unsigned char,int,int)’ to ‘void (__cdecl *)(unsigned char,int,int)’
I was wondering what I can do to fix this. The program works if I specify a keyboardfunc within my main source file that sets up glut and then simply call the member function from there but that’s just a superfluous function call I don’t want to do. Any insight on this would be greatly appreciated. Thanks in advance,
Clearly it is not the case that this will work (since it doesn’t) but if you had the time and were willing I’d appreciate a little more info. I thought that since I was passing menu.KeyBoardFunc and not SimpleMenu::KeyBoardFunc it would use the class instance of menu.
Thanks for your advice any additional input is greatly appreciated.