foo->Resize
by itself is not a valid expression in C++. So, your code is flat out invalid. The only way to obtain a pointer to a non-static member function in C++ is to explicitly use the &
operator and to explicitly use the qualified name of the member function. In your case that would be &Foo::Resize
.
However, this is all beside the point, since you apparently need a pointer to an ordinary function not to a member function. A pointer to a member function is an object of completely different nature not even remotely similar to a pointer to an ordinary function. In other words, what you are trying to do is impossible. You can't pass a pointer to your Foo::Resize
to glutReshapeFunc
regardless of what you do.
If you want to call a non-static member function as a callback, it is your responsibility to use some kind of intermediate wrapper function that will receive the call and delegate it to the member function through a proper object. C++ by itself provides no good features for that, but it often can be implemented using specific features of the library you are trying to use (assuming the library is designed with that in mind).