function calls within member functions not working

Hi,

Am trying to call

glutDisplayFunc(FPS_cam::display);

from within
1
2
3
4
5
void FPS_cam::init_callbacks()
{
		    glutDisplayFunc(FPS_cam::display);
		   
}

the error:

..\src\main.cpp:43:36: error: cannot convert 'FPS_cam::display' from type 'void (FPS_cam::)()' to type 'void (__attribute__((__cdecl__)) *)()'
    glutDisplayFunc(FPS_cam::display);

- I call fps_cam.init_callbacks(); from main.
Last edited on
Does anyone see the problem here : ) ?
I don't see why this shouldn't work or at least on the right track. It is now a total of 3 calls by modularization of the display call. That might itself be a reason to unpack it from the function and put it back in main where it came from and stop trying to overorganize.
A similar issue is addressed in this thread
http://www.cplusplus.com/forum/beginner/201043/#msg958853

Basically, all member functions operate on a particular instance of a class, identified by *this. They need an instance of a class in order to do anything.
Topic archived. No new replies allowed.