Re:How to write cross-platform code
by malkia on Friday October 22, 2010 @07:27PM
(#1821936)
As console/pc video game programmer I can just say:
Make it compilable on your target platforms: PC, Wii, PS3, Xbox, what other is needed.
Don't care about other platforms, until they arrive.
Instead of #ifdef, try to find the pattern in your code, and use select macroses such as:
PC_WIIXBOXPS3(pcValue,consoleValue)
or
WII_XBOXPS3_PC(wiiValue,xboxOrPs3value,pcValue)
wrap align, threadlocal, etc. as macro-define.
The UNICODE advise is wrong. These system do not have even working locales, so don't trust strupr(), strlwr(), toupper() - etc. to work correctly for your localized game.
Make it compilable on your target platforms: PC, Wii, PS3, Xbox, what other is needed.
Don't care about other platforms, until they arrive.
Instead of #ifdef, try to find the pattern in your code, and use select macroses such as:
PC_WIIXBOXPS3(pcValue,consoleValue) or WII_XBOXPS3_PC(wiiValue,xboxOrPs3value,pcValue)
wrap align, threadlocal, etc. as macro-define.
The UNICODE advise is wrong. These system do not have even working locales, so don't trust strupr(), strlwr(), toupper() - etc. to work correctly for your localized game.