Is it possible to make one game for linux and win?
and off course other platforms. And if yes, without rewriting the hole program, how?
Sig
There are other OS independent APIs. Clanlib for example, will emit code for different platforms transparently.
Also you can always use Java.
Also you can always use Java.
There are only a couple of things that you really must do, and a couple that arent as nessicery, but can help a lot in the long run.
The first things you must do is try to modularize your code some (if your using C++ i''d imagine this is already the case with objects and all that, but i''m a C person myself..) That way, if the code is not too deeply intertwined it will be easier to port. The second thing you must do is to make sure that all of your OS specific code is in a seperate file (or several of them as the case may be) A good way to see what i mean is to download the quake 1 source and see how it is divided into parts. Many of the parts seem to be duplicated if you look at the file names (sys_win.c, sys_dos.c, sys_sun.c, and things like that) That is so all the OS specific functionality in those modules can be duplicated for another OS and you dont have to change the source of the OS independent modules that use them.
You can also make your own versions of some library functions that you use to keep the game as library neutral as possible. that way your lib functions work the same way even if the library functions of different platforms work in subtly different ways.
As hard as i imagine it was to read this mess
, i hope it helped some or gave you an idea where to look for more answers.
HitScan
The first things you must do is try to modularize your code some (if your using C++ i''d imagine this is already the case with objects and all that, but i''m a C person myself..) That way, if the code is not too deeply intertwined it will be easier to port. The second thing you must do is to make sure that all of your OS specific code is in a seperate file (or several of them as the case may be) A good way to see what i mean is to download the quake 1 source and see how it is divided into parts. Many of the parts seem to be duplicated if you look at the file names (sys_win.c, sys_dos.c, sys_sun.c, and things like that) That is so all the OS specific functionality in those modules can be duplicated for another OS and you dont have to change the source of the OS independent modules that use them.
You can also make your own versions of some library functions that you use to keep the game as library neutral as possible. that way your lib functions work the same way even if the library functions of different platforms work in subtly different ways.
As hard as i imagine it was to read this mess

HitScan
--HitScan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement