I decided to make a GlutApp class to make using glut easier. And faced with such a problem. I made a virtual function in the GlutApp class:
class GlutApp { //... virtual void Display(); //... };
And in the designer wrote the following:
GlutApp::GlutApp(int argc, char **argv) { //... glutDisplayFunc(Display); //... }
As a result, I got the error:
glutapp.cpp:11:26: error: cannot convert 'void (GlutApp::*)()' to 'void (*)()' for argument '1' to 'void glutDisplayFunc(void (*)())'
And three more similar. Why is that? How to rectify the situation? How to make a class method a callback function?