PDA

View Full Version : glutKeyboardFunc problem



11-09-2002, 10:03 AM
Hi,

I am trying to use the glutKeyboardFunc function which takes the function myKeyboard as an argument, eg,

glutKeyboardFunc(myKeyboard);

myKeyboard has the parameter list: unsigned char thekey, int x, int y

When I run the program I am getting an error:

[C++ Error] GlSkel.cpp(118): E2034 Cannot convert 'void (* (_closure )(unsigned char,int,int))(unsigned char,int,int)' to 'void (*)(unsigned char,int,int)'.

Any ideas as to what i'm doing wrong???

Thanks.

Bob
11-09-2002, 12:00 PM
Try cast the function pointer to the proper type.



glutKeyboardFunc(reinterpret_cast<void (*)(unsigned char,int,int)>(myKeyboard));