Advertisement

Cross-Platform?

Started by January 09, 2003 12:19 AM
3 comments, last by vtnwesley 21 years, 10 months ago
Given that I havent even started with programming yet, this may be a dumb Q, but I shall ask anyway. How does one accurately port games to other platforms (i.e. Windows to Mac OS X to Pocket PC to PSX, etc, etc)?
Hello

Well basically the sourcecode has to be compiled on the different platforms. But there are some problems with this and that is what is tipically called porting. There are some differences, some libraries exist on some platforms and not others (an example of this is direct3d only excists on windows) you would have to use opengl. As well the libraries for creating a window are not the same. Once you have resolved this issues then there are little differences like socks on windows and socks on linux are use a different type of integer.

Hope that helps
Ben
Advertisement
Well, OpenGL is good for Linux, Mac OS X, and Windows... what about Pocket PC, PSX/PS2, Gamecube, and GameBoy Advance? How do you do porting with those and where would you find official tools for it?
Official tools for console platforms cost thousands of dollars for the SDK''s. Unofficial tools (which basically arise from reverse-engineering the platform) are usually pretty incomplete. On top of that, they all use diffenent API''s as well (as far as I know).
Well there are alot of considerations when making something cross platform. First and foremost you have to be semi-familiar with the initial target platform. If you plan to have your game on multiple platforms and you also plan to do the porting yourself (Normally ports are not done at the studios who do the initial products) then you must design your game engine accordingly. For instance you wouldn''t want to use OpenGL or Direct3d explicit calls in your game code. You''d have to create somewhat of an abstraction layer to provide you access to a multitude of API''s. Why is this? Well because each and every platform has it''s own API''s. OpenGL is fairly standardized over *nix, win32 and MacOS platforms. However the console market''s completely different both PS2 and Gamecube have API''s that are similar to OpenGL but they are not OpenGL. This means that the function calls aren''t exactly alike and you can''t rely on them being the same. You also have to take into consideration big endian to little endian conversions. If you don''t know what this is use www.google.com to look up big endian and little endian. Needless to say this requires that you create a large majority of your own data types and stay away from the common win32 keywords such as DWORD. Also durring the porting process you''ll be working with different compilers. All compilers are not the same and they don''t always work as expected. So sometimes you''ll need to make modifications to a template so that it works in GCC, and you''ll break the PC version which was built with VC.net.

There will be alot of #ifdef''s and #ifndef''s to provide compiler compatability. There will be alot of custom code for each platform as well irregaurdless of which API''s you use. It''s not an easy task and I wouldn''t reccomend you even try at this stage. After all this is the beginners forum

This topic is closed to new replies.

Advertisement