Para passar um ponteiro para uma função de membro

Eu tenho uma classe com funções de instância (ou métodos?). De dentro de uma instância, tento passar ponteiros para essas funções para uma biblioteca. A biblioteca espera funções estáticas.

Quando eu passo meus ponteiros para as funções de callback, o compilador reclama que minhas funções não são estáticas. Eu tentei colocá-los estáticos, mas se eu fizer isso, então eu não posso acessar os campos de instância de dentro das funções.

Como eu poderia contornar isso?

Pergunta semelhante é:Usando uma função de membro de classe C ++ como uma função de retorno de chamada C onde eles sugerem colocar o método estático. No entanto, não posso fazer isso ou não vejo como posso.

Código
GlutController::GlutController (int argc, char **argv) {

   // stuff ..

   // Register callbacks
   glutSpecialFunc( OnSpecialKeys );  // Error, need static functions
   glutReshapeFunc( OnChangeSize );   // Error...
   glutDisplayFunc( OnRenderScene );  // Error...

   // stuff ..
}

GlutController::~GlutController() {

}

void GlutController::OnChangeSize(int aNewWidth, int aNewHeight){

   glViewport(0,0,aNewWidth, aNewHeight);
   mViewFrustrum.SetPerspective( APP_CAMERA_FOV,             // If this function is 
            float( aNewWidth ) / float( aNewHeight ),        // static, this won't 
            APP_CAMERA_NEAR,                                 // work
            APP_CAMERA_FAR );
   mProjectionMatrixStack.LoadMatrix(                        // Same here
            mViewFrustrum.GetProjectionMatrix() );
   mTransformPipeline.SetMatrixStacks(mModelViewMatrixStack, // Same here  
            mProjectionMatrixStack);

}

void GlutController::OnRenderScene(void){
   mGeometryContainer.draw();                                // Won't work if static
}

void GlutController::OnSpecialKeys(int key, int x, int y){
   mGeometryContainer.updateKeys(key);                       // Won't work if static
}

Disclaimer: Acabei de começar o C ++. Eu li todo o Accelerated C ++ e este é meu primeiro projeto para experimentar a linguagem. Minha experiência é em Java.

questionAnswers(4)

yourAnswerToTheQuestion