Well, it's just 1 line of code regardless of how many possible scenes you have. A switch statement grows with the number of functions.
Consider:
| GameState->CurrentSceneFunc(MemPool, Platform, Renderer, Input, TimeInfo);
|
Versus:
1
2
3
4
5
6
7
8
9
10
11
12
13
14 | SCENE_UPDATE_FUNC((*CurrentSceneFunc));
switch(GameState->CurrentScene){
case SceneMenu:
CurrentSceneFunc = menuUpdateAndRender;
break;
case SceneMainGameplay:
CurrentSceneFunc = mainGameplayUpdateAndRender;
break;
case SceneEditor:
CurrentSceneFunc = editorUpdateAndRender;
break;
[...]
}
CurrentSceneFunc(MemPool, Platform, Renderer, Input, TimeInfo);
|
It's not a hugely important thing, but it's something I'd like to avoid if possible.
Although from your responses so far I guess there isn't really much one can do in this case..