M
Martin Magnusson
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:rawC()
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:rawC );
}
void GraphicDisplay:rawC()
{
// some code...
}
//---end code.
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:rawC()
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:rawC );
}
void GraphicDisplay:rawC()
{
// some code...
}
//---end code.