Hi there...
I don't seem to figure out the correct syntax for calling a function that has its pointer stored in an array.
The following is the code sample:
// define function pointers
typedef void(MainGame::*FunctionPointer)(void*);
// we could have 4 rendering functions.
FunctionPointer RenderFunctions[4];
RenderFunctions[0] = &MainGame::GameRender; // normal game rendering.
RenderFunctions[1] = &MainGame::SplashRender; // render the splash screen.
RenderFunctions[2] = &MainGame::TitleScreenRender; // render the title screen.
RenderFunctions[3] = &MainGame::RenderMapDesigner; // render the designer.
...
FunctionPointer F = (RenderFunctions[CurrentRenderStage]);
(*F)(nullptr); // this is the only statement that does not compile.
The error message I am getting from visual studio is: Operand of '*' must be a pointer.
Any help is highly appreciated. :)
yours sincerely.
mkaatr