I am trying to use Glut in C++, but I am having issues when I try to put my display function within the Renderer class.
The error i have is: error C2227: left of '->display' must point to class/struct/union/generic type
So far I have the following :
class Renderer
{
public:
Renderer *gRenderer;
...
}
int Renderer::start(Renderer r)
{
...
setRenderer(r);
glutDisplayFunc(&Renderer::staticDisplay);
...
}
void Renderer::setRenderer(Renderer r){
*gRenderer = r;
}
void Renderer::staticDisplay(){
gRenderer->display();
}
void Renderer::display()
{
... show stuff
}
I am not sure what I am doing wrong :(
Thanks for all the help!