-
- How to make code cross platform
- Using preprocessor and Compile Time Pound Define
- Not legible, for both users and creators.
- It assumes that the control flow of your program is shared on all platforms that you will ever ship on.
- Using a virtual abstract layer to eliminate the difference between different operating systems, so that the actual game code can call one single unified layer to finish all the operations.
- Instead of the platform layer being a series services to the game, we consider the game as services to the operating system to produce the graphics and sound to play the game.
- Using preprocessor and Compile Time Pound Define
- Unity Build: Only have one conceptional translation unit.
- No need to have a complex build system.
- Fast.
- While doing including, put as much your code before platform specific headers as possible, so that you can make sure your code is will isolated from platform code.
- How to make code cross platform