I want to pass Resize method of my Foo class object as the argument of glutReshapeFunc() but I get that error.
How should I pass it?
This is my definition of Resize:
class Foo{
public:
void Resize(int w, int h);
...
}
and this is how I try to call it
glutReshapeFunc(foo->Resize);
It was ok when foo was not a pointer, I use to pass foo.Resize and it worked.
Thanks in advance
Non-static functions take an additional hidden parameter (
this) so they’re not compatible with a global, non-member, function with apparently similar signature.You could make
Resizea static, but you’ll have problem figuring out on what object to act.glutReshapeFuncmentions thatso you can start from there in your static member.