"Martin Magnusson" <lo*******@frustratedhousewives.zzn.com> wrote in message
news:bj**********@green.tninet.se...
GraphicDisplay.cpp:15: error: no matches converting function `DrawC' to
type `void (*)()'
GraphicDisplay.hpp:11: error: candidates are: void GraphicDisplay::DrawC()
Glut is a C library, and it expects a pointer to a C function.
So you cannot pass a non-static member function to it.
What will probably work is to replace: void DrawC();
with:
static void DrawC();
But yes, this will force you to use global variables (DrawC will not
be able to access non-static member variables of class GraphicDisplay.
Note that, in theory, you also need to add an extern "C"
in front of the function's declaration (this is to formally
follow the standard, but this is rather rarly used in such
a context...)
hth,
--
http://www.post1.com/~ivec <> Ivan Vecerina