Sign in to follow this  
derek7

cross - platform

Recommended Posts

what does it mean? does platform mean os or hardware(cpu)? some one tell me platform mean os other than hardware.

Share this post


Link to post
Share on other sites
It stands for compatibility between different software (operating systems).
But this software may run on different hardware too.

So, an application that runs on Windows and Linux is cross-platform and often runs on the same hardware. An application running on Windows and Mac OS is also cross-platform, with two operating systems running on two different hardware architectures.

Usually, additionnal care will be required when the hardware is different for the supported operating systems, such as the memory bytes order for example, which is inverted on Intel-family systems and Apple systems.

Share this post


Link to post
Share on other sites
It should be noted that with the new Apples using Intel processors that endianness is no longer an issue (unless you are making games that will still support PPC processors).

Share this post


Link to post
Share on other sites
why does cross-platform matter? why does cross-hardware not matter?
if a app is cross - platform ,does it also mean cross - hardware ?

for example a app can run on linux well, it will easy to run on all hardware that use linux? is it reason that cross - platform does matter?

Share this post


Link to post
Share on other sites
Different CPU families have different machine code, when you compile a high level program like something written in C/C++ the result is a bunch of machine code. Different compilers for different operating systems output different types of machine code, hence one program compiled on say a windows box for a 80x86 cpu, will not run on a PS2 since its CPU has a different machine language. This is the reason why assembly language programs are typically not portable like C/C++ programs are. There are also other issues like endianess that play a factor in things, i.e.: if you write a 4 byte integer to a file on a PC it will most likely store is say:

04 00 00 00

If you did the same on a Mac, it'd store it:

00 00 00 04

Hope this helps :-)

Share this post


Link to post
Share on other sites
standard C or C++ have compilers for many many different CPU's and OS, so if you are using only the standard C++ your code is cross platform (and "cross hardware") you simply use the compiler you want to compile the code and get the OS specific program.

There are some endians issues that are not met by the standard, so if you write to file a number when the program is compiled one way, it may not be readable by the same program that is compiled another way.

The problem begins when you try to do things that arent in the C++ standard, for example open a graphical window with a mouse and such. To do this you need to use OS functions and each OS has its own.

Also another problem is if you interact with the hardware and need hardware specific stuff (games are more prone to this than regular applications, since you may write your game to work only on a certain type of video card).

The best is when you write your OS specific code seperate from the rest of the program so that it can be exchanged easily. It is possible to use the precompiler to detect which platform it is being compiled for and this way switch certain code on or off, so the same source file will be compiled for many platforms.

Share this post


Link to post
Share on other sites
Cross platform generally refers to Running on more than one system, at least in the context of commercial software. But to really understand the definition of Cross platform, you have to make the observation that the hardware itself is really just another "platform" on which the OS runs.

So, in this new context, there is the "hardware platform" and the "software platform" which, for now, we'll limit the discussion to Operating system software.

So, as has been mentioned, if you have a game which can be run on Windows and Linux you have a game which could be said to be "cross-platform" but only in the sense that it will only run on one underlying hardware platform, ie the x86 PC-Compatibile. Linux, however, can also run on Mips, PPC, Alpha and Sparc CPUs. Unless considerations are taken of this fact, a game designed for x86 CPUs may not run correctly or at all. The other CPUs might have a different endian-ness, different accuracy characteristics for floating-point calculations, or lack floating point hardware entirely. You would have to take these same issues into consideration if there were a version of Windows which ran on these other CPUs as well. Back in the Windows NT 4.0 days, there were versions of it for x86, Alpha and PowerPC CPUs (possibly MIPS and Sparc as well, I don't know for sure) and there are modern versions of Windows Server which run on Intel's Itanium CPU.

If you wanted to get theoretical about it, one could argue that a computer built on Quantum Principles is a "platform" one step lower than the "hardware platform" and on the other side, different APIs could be said to be a platform one step above the "OS Software Platform" ie Win32 vs. Win16 APIs.

Practically Speaking, Cross platform means Support for 2 or more Operating Systems and may imply hardware independance in some cases. Hardware independance means support for multiple underlying hardware platforms.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ravyne
Cross platform generally refers to Running on more than one system, at least in the context of commercial software. But to really understand the definition of Cross platform, you have to make the observation that the hardware itself is really just another "platform" on which the OS runs.

So, in this new context, there is the "hardware platform" and the "software platform" which, for now, we'll limit the discussion to Operating system software.

So, as has been mentioned, if you have a game which can be run on Windows and Linux you have a game which could be said to be "cross-platform" but only in the sense that it will only run on one underlying hardware platform, ie the x86 PC-Compatibile. Linux, however, can also run on Mips, PPC, Alpha and Sparc CPUs. Unless considerations are taken of this fact, a game designed for x86 CPUs may not run correctly or at all. The other CPUs might have a different endian-ness, different accuracy characteristics for floating-point calculations, or lack floating point hardware entirely. You would have to take these same issues into consideration if there were a version of Windows which ran on these other CPUs as well. Back in the Windows NT 4.0 days, there were versions of it for x86, Alpha and PowerPC CPUs (possibly MIPS and Sparc as well, I don't know for sure) and there are modern versions of Windows Server which run on Intel's Itanium CPU.

If you wanted to get theoretical about it, one could argue that a computer built on Quantum Principles is a "platform" one step lower than the "hardware platform" and on the other side, different APIs could be said to be a platform one step above the "OS Software Platform" ie Win32 vs. Win16 APIs.

Practically Speaking, Cross platform means Support for 2 or more Operating Systems and may imply hardware independance in some cases. Hardware independance means support for multiple underlying hardware platforms.



thanks it is very clear.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this