Hello I've decided to structure my game the same way as Casey did in (at least) the earlier episodes of HMH.
I have 2 dll's that make up the whole thing. 1 for the platform layer and 1 for the game, which gets dynamically loaded.
In speudo code tt's basically this:
- update(memory, platformAPI, graphicsAPI);
(audio would be done in a similar fashion using openAL)
The platform dll is the entry point and then calls the game dll's update & render functions in a loop.
The platform & graphics API structs then hold function pointers to stuff set up by the platform layer...
So the game uses these to load textures from disk or draw stuff.
I figured that this setup should make porting "fairly" simple as I would just need to replace the platform layer and give the game 'all it needs' to run.
However I was wondering... does this separation have any performance issues? And do you guys see any problems for porting this kind of setup to another platform?
Thanks for reading :)