
I have a main file from my OpenGL program which contains global
variables and the functions that are used by OpenGL as callback
functions. For example:
int a;
float b;
void display ()
{
.... display code calls ...
}
int main (int argc, char **argv)
{
glutDisplayFunc( display );
}
Now I thought I would put all the variables and functions into a class
and use that in the main. Here is where I am getting stuck on the use of
boost::function. I changed the code to look something like the
following:
class MyMain {
int a;
float b;
void display()
{
... display code calls ...
}
}
int main (int argc, char **argv)
{
MyMain m_ref;
boost::function