Hi all. I'm having trouble registering a GLUT callback function.
glutIdleFunc wants a void(*)() function as argument, and I believe
that's what I've given it, but gcc complains with the following message:
GraphicDisplay. cpp:15: error: no matches converting function `DrawC' to
type `void (*)()'
GraphicDisplay. hpp:11: error: candidates are: void GraphicDisplay: :DrawC()
Can anyone see what I'm missing here?
//---begin code:
class GraphicDisplay
{
public:
void Init();
void DrawC();
};
void GraphicDisplay: :Init()
{
// Standard GLUT init stuff...
// (snip)
glutIdleFunc( GraphicDisplay: :DrawC );
}
void GraphicDisplay: :DrawC()
{
// some code...
}
//---end code.
Comment