I want to take the OpenGL functionality from the main source file to a separate class.
// Initialize rendering (GLUT and GLEW)
gfxMgr.init(argc, argv);
...
glutReshapeFunc(gfxMgr.resizeWindow);
glutKeyboardFunc(gfxMgr.keyPressed);
glutKeyboardUpFunc(gfxMgr.keyReleased);
The problem started with defining the callback functions within the class' implementation file. I declared them in the header file as static.
static void init(int , char** );
...
static void drawScene();
static void whenIdle();
Then another problem followed. I want to use a non-static boolean fullScreen variable (as declared in the header) in one of the static functions of my implementation file, but the IDE tells me that "a non-static member reference must be relative to a specific object".
void GfxMgr::init(int argc, char** argv)
{
...
if(fullScr) glutFullScreen();
...
}
I don't understand the problem and I don't know what to do. I declared the boolean and a few other variables as static but came up with a bunch of unresolved external symbol errors.