I want to write a simple class which initializes openGL. I decided to create method run where I initialize opengl, glutDisplayFunc, glutMainLoop.
I want to pass draw function to this method and use it as a parameter for glutDisplayFunc
void OpenGL::run(void(*drawFunction())) {
this->init();
glutDisplayFunc(drawFunction);
glutMainLoop();
};
But I've got an error argument of void type *(*)() is incompatible with parameter of type void (*)().
It does not work glutDisplayFunc(&drawFunction); and glutDisplayFunc(*drawFunction); either.
What's the problem?