I'm separating my code into multiple files, but this is one thing I don't get.
In graphics.h:
...
class graphics {
public:
virtual void SizeMod(int w, int h);
...
}
In graphics.cpp:
...
void SizeMod(int w, int h) {
//Code here.
}
...
In main.cpp:
...
graphics g;
...
int main (int argc, char **argv) {
...
glutReshapeFunc(g.SizeMod);
...
}
Error:
error C3867: 'graphics::SizeMod': function call missing argument list; use &graphics::SizeMod to create a pointer to member
And so I did that:
...
graphics g;
...
int main (int argc, char **argv) {
...
glutReshapeFunc(&graphics::SizeMod);
...
}
It still gives me an error (a different one). Anything to solve this problem?